当前位置:Gxlcms > 数据库问题 > mysql密码重置

mysql密码重置

时间:2021-07-01 10:21:17 帮助过:36人阅读

Mysql密码重置

■5.1修改配置文件为免授权

___________________________________________________________

[root@lab-1-C6 ~]# mysqladmin -uroot password ‘111qqq...‘
[root@lab-1-C6 ~]# mysql -uroot -p111qqq...
[root@lab-1-C6 ~]# vim /etc/my.cnf
[root@lab-1-C6 ~]# /etc/init.d/mysqld restart
Shutting down MySQL. SUCCESS!
Starting MySQL. SUCCESS!
[root@lab-1-C6 ~]# mysql 
mysql> update user set password=password(‘111qqq...‘) where user=‘root‘;
mysql> select * from user where user=‘root‘\G; 
[root@lab-1-C6 ~]#vim /etc/my.cnf   #删除以下内容
skip-grant  
[root@lab-1-C6 ~]#/etc/init.d/mysqld restart
[root@lab-1-C6 ~]# mysql      #无法登录
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
[root@lab-1-C6 ~]# mysql -uroot -p111qqq...


本文出自 “抚琴煮酒” 博客,请务必保留此出处http://szk5043.blog.51cto.com/8456440/1762963

mysql密码重置

标签:mysql密码重置

人气教程排行