【MySQL】MySQL错误分析及解决

1 error: log-error set to '/u01/data/mydb/3306/error/3306.err'

错误描述:

[root@strong ~]# service mysqld start
Starting MySQL.2019-05-12T09:39:38.619861Z mysqld_safe error: log-error set to '/u01/data/mydb/3306/error/3306.err', however file don't exists. Create writable for user 'mysql'.
ERROR! The server quit without updating PID file (/u01/data/mydb/3306/db/strong.oracle.com.pid).

解决:

[root@strong ~]# touch /u01/data/mydb/3306/error/3306.err
[root@strong ~]# chown mysql:mysql /u01/data/mydb/3306/error/3306.err

2 [ERROR] InnoDB: The Auto-extending innodb_system data file '/u01/data/mydb/3306/ibdata/ibdata1' is of a different size 768 pages (rounded down to MB) than specified in the .cnf file

错误描述:

2019-05-12T09:59:56.929556Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/u01/data/mydb/3306/ibdata/ibdata1' is of a dif
ferent size 768 pages (rounded down to MB) than specified in the .cnf file: initial 1536 pages, max 0 (relevant if non-zero) pages!
2019-05-12T09:59:56.929883Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-05-12T09:59:57.537660Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-05-12T09:59:57.537964Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-05-12T09:59:57.537985Z 0 [ERROR] Failed to initialize builtin plugins.
2019-05-12T09:59:57.537996Z 0 [ERROR] Aborting

解决:

出现这个错误的原因是ibdata1的大小和my.cnf中配置的不一致导致,将配置文件的该文件的大小改为和真实的文件大小一致即可。

[root@strong ~]# ll -h /u01/data/mydb/3306/ibdata/ibdata1
-rw-r-----. 1 mysql mysql 12M May 12 17:56 /u01/data/mydb/3306/ibdata/ibdata1

3 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

错误描述:

2019-05-12T10:07:34.841161Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2019-05-12T10:07:34.841196Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2019-05-12T10:07:34.841275Z 0 [ERROR] Aborting

解决:

出现这个错误的原因是配置文件的datadir设置有误,导致不能找到mysql数据库下的user表,修改配置即可。
datadir=/u01/data/mydb/3306/db

posted @ 2019-05-12 18:19  追梦男生  阅读(2018)  评论(0编辑  收藏  举报