mysql初始化错误【一】

MySQL 初始化DATA报错

[ERROR] InnoDB: io_setup() failed with EAGAIN after 5 attempts.
[ERROR] InnoDB: Cannot initialize AIO sub-system
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize plugins.

解决方法:

$ cat /proc/sys/fs/aio-max-nr
65536                        #64k个

$ vi /etc/sysctl.conf
fs.aio-max-nr=262144         #调整为256k个

$ sysctl -p

mysql初始化错误【二】

Can't find error-message file '/usr/local/mysql/errmsg.sys'

环境:RPM包安装的MySQL,自己能找到lib库

原因:一般是初始化的basedir 的路径指定错误了,basedir 一般指定数据库的bin,lib之类的文件

解决方法:初始化的去掉basedir

mysqld --initialize --user=mysql --datadir=/data