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/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章