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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM