MySQL root密码忘记怎么办?老男孩MySQL培训周末班

    /    2019-09-11

MySQL单实例?

1 跳过授权表登录

mysqld_safe --skip-grant-table --user=mysql &

2 更改密码

mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';

 

MySQL多实例?

1 跳过授权表登录 登录指定多实例的socket的文件

mysqld_safe --defaults-file=/data/3306/my.cnf  --skip-grant-table --user=mysql &

mysql -S /data/3306/mysql.sock  登录数据库

2 更改密码

mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';

互联网企业大多用的数据库是MySQL的,想要众多的IT工作者中脱颖而出,就需要拥有高深的技术,学习增值是必不可少的。学习之路,是贵在坚持的。老男孩教育MySQL DBA课程,几经更新课程,杜绝纸上谈兵,全企业真实案例结合理论授课,想深入的学习MySQL DBA的知识,可以关注下老男孩教育。


(0)

分享至