關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 修改 MySQL 唯讀參數

    Posted on September 11th, 2009 Sam Tang No comments

    要修改 MySQL 唯讀參數,一般上也會修改 my.cnf 的內容,然後重新啟動 MySQL。但如果有一特殊需要也能重新啟動 MySQL 的話,可以用 Domas Mituzas Blog 上面的方法:「Evil replication management」

    例如在正常的情況下修改 log_slave_updates 參數,會出現這個 error:

    mysql> set global log_slave_updates=1;
    ERROR 1238 (HY000): Variable ‘log_slave_updates’ is a read only variable

    而文章內所提供的是非正規方法,所以閣下使用時要自行承擔風險,方法如下:

    mysql> system gdb -p $(pidof mysqld) -ex "set opt_log_slave_updates=1" -batch

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word