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服务登陆即可

posted @   程长新  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
点击右上角即可分享
微信分享提示