服务器重启后mysql启动报错:
[root@db-01 ~]# service mysqld start
Starting MySQL.The server quit without updating PID file (/[FAILED]l/db/data/db-01.pid).[root@db-01 ~]# ll
查看mysql日志
[root@db-01 mysql-5.5.46]# tail -f /tmp/mysql-error.log
160825 19:14:34 [Warning] The syntax '--log' is deprecated and will be removed in a future release. Please use '--general-log'/'--general-log-file' instead.
160825 19:14:34 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
160825 19:14:34 [Warning] option 'log_queries_not_using_indexes': boolean value '/tmp/mysql-nouseindex.log' wasn't recognized. Set to OFF.
160825 19:14:34 [Note] /usr/local/db/mysql-5.5.46/bin/mysqld (mysqld 5.5.46-log) starting as process 23091 ...
160825 19:14:34 [ERROR] COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'latin1'
160825 19:14:34 [ERROR] Aborting
160825 19:14:34 [Note] /usr/local/db/mysql-5.5.46/bin/mysqld: Shutdown complete
160825 19:14:34 mysqld_safe mysqld from pid file /usr/local/db/data/db-01.pid ended
问题处理:
增加:
character-set-server = utf8
修改为:
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/db/data
character-set-server = utf8
启动正常。

本文记录了一次服务器重启后MySQL无法启动的问题及解决过程。通过查看日志发现是字符集设置不匹配导致的服务启动失败,最终通过调整配置文件中的字符集参数解决了问题。
14万+

被折叠的 条评论
为什么被折叠?



