今天在CentOS 7上用源码安装MySQL时遇到如下错误:
oot@dbhost01:~# /opt/mysql/server-5.6/scripts/mysql_install_db –user=mysql
Installing MySQL system tables…/opt/mysql/server-5.6/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
root@dbhost01:~#
当我们使用“mysql_install_db”安装MySQL时,需要libaio包,现将不同Linux系统安装该包的方式总结如下:
1、对于Redhat/CentOS系统用如下安装方式:
[root@dbhost01~]# yum install libaio
2、对Debian系统用如下安装方式:
root@dbhost01:~# apt-get install libaio1
安装了这个包之后,再次执行“mysql_install_db” ,这次就没有错误了。