一、安装mysql完毕后初始化失败
【/usr/local/mysql/bin】./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize
输入命令:apt-get install libaio1 libaio-dev
二、初始化成功后重启服务失败
root@yanhong:/usr/local/mysql# support-files/mysql.server start
将mysql.server放到系统管理中:cp support-files/mysql.server /etc/init.d/mysqld
用ls查看mysql的相对路径
root@yanhong:/usr/local/mysql# sudo /etc/init.d/mysqld start
查看mysql的活动状态
root@yanhong:/usr/local/mysql# cd bin
root@yanhong:/usr/local/mysql/bin# service mysqld status
三、修改mysql密码的时候报错
root@yanhong:/usr/local/mysql/bin# mysql -u root -p
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
输入:root@yanhong:/usr/local/mysql/bin# apt install libncurses*会显示
再次输入命令 root@yanhong:/usr/local/mysql/bin# mysql -u root -p然后粘贴初始化时生成的初始密码:
然后输入之后我又报错!!!:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/usr/local/mysql/mysql.sock' (2)
此时重启一下mysql即可:root@yanhong:/usr/local/mysql/bin# systemctl restart mysql
exit退出登录测试一下输入修改过的密码是否成功进入mysql
成功。
设置远程连接: