centos8安装mysql5.7版本

这篇博客是对一个配置博客所遇问题的解决办法,
原博客链接:https://blog.csdn.net/qq_37598011/article/details/93489404?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1

问题1,./mysql -u root -p命令报错,信息如下
./mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
解决方法:

sudo yum install libncurses*

完美解决。

问题2,登陆时键入密码,使用enter键报错,信息如下:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
解决方法:
修改配置文件跳过密码验证
vim /etc/my.cnf(注:windows下修改的是my.ini)
[mysqld]后面任意一行添加“skip-grant-tables”用来跳过密码验证的过程
然后重启mysql

service mysql restart

接下来修改密码:

#首选选择一个数据库,不然会报错
use root;
update user set authentication_string=password('新密码') where user='root';
flush privileges;
quit;

问题3,登录后键入命令都会报如下错误
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解决方法如下:

alter user user() identified by "新密码";

over!!!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值