Mysql
mysqld_multi 不辨識組
我正在嘗試將 MySQL 伺服器配置為執行守護程序的多個實例(我希望將其複製到不同的驅動器上)。我一直在嘗試使用 mysqld_multi 腳本。但是腳本沒有在
/etc/mysql/my.cnf
.我將配置複製並粘貼
msqld_multi --example
到 my.cnf 中,這發現了組罰款。但是,當我嘗試修改下面的文件時,mysqld_multi report
只顯示:Reporting MySQL servers No groups to be reported (check your GNRs)
下面是我的 my.cnf 文件的縮寫。
[mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld1] #this is for the master server pid-file =/var/run/mysqld/mysqld.pid socket =/var/run/mysqld/mysqld.sock port =3306 datadir=/var/lib/mysql server-id=1 log-bin=mysql-bin [mysqld2] #for the slave! pid-file =/var/run/mysqld-slave/mysqld-slave.pid socket =/var/run/mysqld-slave/mysqld-slave.sock port =3307 datadir =/var/lib/mysql-backup server-id=2 skip-innodb default-storage-engine =myisam [mysqld_multi] user = mysql [mysqld] basedir = /usr tmpdir = /tmp ...
這裡有一小段來自
mysqld_multi --example
[mysqld_multi] mysqld = /usr/bin/mysqld_safe mysqladmin = /usr/bin/mysqladmin user = multi_admin password = my_password [mysqld2] socket = /tmp/mysql.sock2 port = 3307 ...
誰能發現為什麼 mysqld_multi 不解析這個?
我發現了問題。mysqld_multi 根本無法解析註釋,所以你只需要從my.cnf 中刪除所有前面帶有# 的註釋行。