参考帖子:
http://blog.csdn.net/ty0415/article/details/22958133
首先,在 MySQL 官方网站上下载安装包, 如图:
然后,执行安装命令
bin/mysql_install_db --user=mysql --basedir=/home/devil/mysql57/ --datadir=/home/devil/mysql57/data/
报错:
2018-01-24 07:57:03 [ERROR] Can't locate the language directory.
发现其中有如此这个警告:
[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
于是,更换安装方法:
bin/mysqld --initialize --user=mysql --basedir=/home/devil/mysql57/ --datadir=/home/devil/mysql57/data/
报错:
bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
根据博客开头给出的参考帖内容,进行一下措施:
sudo apt-get install libaio1
再次执行安装:
bin/mysqld --initialize --user=mysql --basedir=/home/devil/mysql57/ --datadir=/home/devil/mysql57/data/
已经能够生成临时密码,证明操作成功。