在初始化mysql时,报错

# scripts/mysql_install_db --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql

Could not open required defaults file: /root/.my.cnf

Fatal error in defaults handling. Program aborted

Installing MariaDB/MySQL system tables in '/data/mysql' ...

/usr/local/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory


Installation of system tables failed!  Examine the logs in

/data/mysql for more information.


The problem could be conflicting information in an external

my.cnf files. You can ignore these by doing:


    shell> /usr/local/mysql/scripts/scripts/mysql_install_db --defaults-file=~/.my.cnf


You can also try to start the mysqld daemon with:


    shell> /usr/local/mysql/bin/mysqld --skip-grant --general-log &


and use the command line tool /usr/local/mysql/bin/mysql

to connect to the mysql database and look at the grant tables:


    shell> /usr/local/mysql/bin/mysql -u root mysql

    mysql> show tables;


Try 'mysqld --help' if you have problems with paths.  Using

--general-log gives you a log in /data/mysql that may be helpful.


The latest information about mysql_install_db is available at

https://mariadb.com/kb/en/installing-system-tables-mysql_install_db

MariaDB is hosted on launchpad; You can find the latest source and

email lists at http://launchpad.net/maria


Please check all of the above before submitting a bug report

at http://mariadb.org/jira


报错:/usr/local/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory,因为缺少libaio模块


解决:

yum search libaio

yum -y install libaio

再次执行scripts/mysql_install_db 即可成功,启动mysqld..SUCCESS