MySQL查看默认密码和修改密码

查看默认密码

1. 查找日志目录

find / -name mysqld.log

2. vim 查看

3. 搜索password关键字


修改密码

1. 使用默认密码登陆

2. 修改密码

MySQL5.7及以下版本:update mysql.user set authentication_string=password('xxxxxx') where user='root';

其他版本:update user set password=password('xxxxxx') where user='root';

3. 立即生效

flush privileges;

 

2024-01-29 09:55:42【出处】:https://www.cnblogs.com/sgh1023/p/14930211.html

=======================================================================================

posted on 2024-01-29 09:56  jack_Meng  阅读(85)  评论(0编辑  收藏  举报

导航