[root@xxx mysql]# service mysql restart
MySQL server PID file could not be found![失败]
Starting MySQL..The server quit without updating PID file ([FAILED]al/mysql-8.0/data/iZuf6i65gjtemwnphbbbhwZ.pid).
搜了一堆解决方法,都没有解决。
可以查看错误日志,找到根本原因,在mysql的data目录
cat iZuf6i65xxxxxxxxxxxxxxxZ.err
2022-01-02T12:45:21.583695Z 0 [System] [MY-010116] [Server] /usr/local/mysql-8.0/bin/mysqld (mysqld 8.0.20) starting as process 451857 2022-01-02T12:45:21.594548Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-01-02T12:45:22.453483Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2022-01-02T12:45:22.459657Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0'). 2022-01-02T12:45:22.460001Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-01-02T12:45:22.460219Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-01-02T12:45:22.981612Z 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0/bin/mysqld: Shutdown complete (mysqld 8.0.20) ?MySQL Community Server - GPL. ?
可以看到报错的根本原因是:
Different lower_case_table_names settings for server ('1') and data dictionary ('0').
lower_case_table_names 配置的意思是表名是否大小写敏感,
这个报错的意思就是服务端这个配置核data目录配置不一致
vim /etc/my.cnf? 中,lower_case_table_names配置是1,改成0,启动成功。
|