Linux中安装mysql8
照着这位老哥写的做的,没问题。
https://blog.csdn.net/qq_45554167/article/details/121907007
其中遇到的问题:
1 wget不能用时:
rpm -qa|grep "wget"
yum remove wget
yum install wget -y
2 执行这条命令时报错:
命令:./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dat
报错:./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or director
解决方案:安装libaio:yum -y install libaio
3 在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问
使用了它生成的临时密码仍然报错
解决方案:
编辑my.cnf文件:vim /etc/my.cnf
在[mysqld]后边添加跳过登陆检查:skip-grant-tables
重启mysql服务:server mysql stop server mysql start
登陆mysql,输入密码时直接回车就行
修改密码:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
如果报:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
输入:flush privileges;
然后再次执行上边的修改密码sql即可成功,然后把my.cnf中的跳过登陆检查删掉再重启mysql服务登陆即可

浙公网安备 33010602011771号