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;

posted @ 2021-06-25 11:35  James_Shangguan  阅读(7369)  评论(0编辑  收藏  举报