加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux连接mysql报错:Access denied for user ‘root’@‘localh

发布时间:2020-12-14 01:16:25 所属栏目:Linux 来源:网络整理
导读:1,在Linux,先进入/etc,修改my.cnf,任意一行加上"skip-grant-tables"。 2,重启MySQL:service mysqld restart 3,use?mysql; update mysql.user set authentication_string=password(‘your new password ‘) where user=‘root‘; 4, flush privileges;

1,在Linux,先进入/etc,修改my.cnf,任意一行加上"skip-grant-tables"。

2,重启MySQL:service mysqld restart

3,use?mysql;

update mysql.user set authentication_string=password(‘your new password‘) where user=‘root‘;

4,flush privileges;

?

? ? ? ? exit;
5,重启MySQL:service mysqld restart? (这步可以省略)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读