Linux系统MySQL初始化后运行报错

问题过程:

初始化数据库:
./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
运行该命令后若出现的报错如下(阿里云CentOS7):

error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

出现该问题首先检查该链接库文件有没有安装使用 命令进行核查

   rpm -qa|grep libaio   

运行该命令后发现系统中无该链接库文件

使用命令,yum install  libaio-devel.x86_64

安装成功后,继续运行数据库的初始化命令,提示成功。
安全启动:
./mysqld_safe --user=mysql &
但是报错:

does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

解决办法:

在MySQL 5.7中,安全性提升,要求切换到安装目录,来启动数据库:
例如安装目录为 /usr/local/mysql/mysql-5.7.17,那么就重新运行启动命令:
bin/mysqld_safe --user=mysql &

成功解决截图:

在这里插入图片描述
感谢博主提供资料:
https://blog.csdn.net/wlphyl/article/details/88664654
http://blog.itpub.net/26506993/viewspace-2136837/

发布了118 篇原创文章 · 获赞 26 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/qq_43147136/article/details/99583898