我有5.5和5.5上的主从,这将是testingENV,以检查5.6是否可以在5.5上对PROD进行复制。
我在启动mysql时遇到下面的错误
ERROR! MySQL server PID file could not be found! Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/test.lester.com.pid).
作为参考,这里是/etc/my.cnf的内容:
# The following options will be passed to all MySQL clients [client] port = 3306 socket=/var/lib/mysql/mysql.sock # The MySQL server [mysqld] port = 3306 socket=/var/lib/mysql/mysql.sock skip-external-locking key_buffer_size = 256M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M bind-address = 0.0.0.0 # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 log-bin=mysql-bin # binary logging format - mixed recommended binlog_format=mixed server-id = 2 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
我尝试了很多选项来解决这个错误…但不幸的是没有运气,请帮助。
这与复制无关,但在添加与复制相关的行时,可能会损坏configuration。 特别是你错过了一个pid-file行,尝试添加到[mysqld]部分:
pid-file = /var/run/mysqld/mysqld.pid
这行目前是[mysqld_safe]部分,我不认为它属于那里。
运行以下命令,确保configuration中的pid文件与mysql cnf文件中的[mysqld]下的pid文件定义相匹配,这很可能是init.d脚本和configuration中的未命中匹配。
mysqld –print-defaults | grep pid文件
阅读关于pid文件的上述文章,我只是想补充说,有时你需要创build它。 你也应该使用ps来检查一下mysql是否已经在运行。
如果mysql正在运行,请将mysql_safe的pid(我认为)添加到您的pid文件中。