Mysql数据库各种情况下密码修改《建议收藏!!!》

一、Windows系统

1、知道密码情况下

(1)Win+R进入DOS窗口

(2)输入mysql -uroot -p你的密码

PS:

(1)默认密码为root。

(2)-u与root,-p与密码之间没有空格。

(3)修改密码时提示Unknown column 'password' in 'field list'

因为新版本mysql采用authentication_string替代了password字段

扫描二维码关注公众号,回复: 8724007 查看本文章

(4)SQL整理

mysql -u root -p
Enter password:****
mysql> use mysql;  选择数据库
Database changed
mysql> update user set authentication_string=password('root2') where user='root' ;
mysql> flush privileges;
mysql> quit;

2、不知道密码情况下

(1)、

二、Linux系统

1、

有用请点赞,养成良好习惯!

疑问、交流、鼓励请留言!

发布了267 篇原创文章 · 获赞 145 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/libusi001/article/details/104000055