問題過程:
初始化數據庫:
./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/