linux mysql下忘记root密码解决办法
2017-06-26 12:12
169 查看
1 修改MySQL的登录设置
# vi /etc/my.cnf在[mysqld]的中加上一句:skip-grant-tables
2 重新启动mysqld
# /etc/init.d/mysqld restartStopping MySQL: [ OK ]
Starting MySQL: [ OK ]
3 登录并修改MySQL的root密码
# /usr/bin/mysqlWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.56
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> USE mysql ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User =
'root' ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
4 将MySQL的登录设置修改回来
# vi /etc/my.cnf将刚才在[mysqld]的段中加上的skip-grant-tables删除
保存并且退出vi。
5 重新启动mysqld
# /etc/init.d/mysqld restart Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
Work for fun,Live
for love!
相关文章推荐
- [转]windows服务器忘记mysql管理员root密码的解决办法
- Ubuntu忘记root密码解决办法
- Red Hat Linux忘记root密码的解决办法
- 忘记mysql数据库root用户密码的解决办法
- 忘记Linux下root用户密码解决办法
- Linux的ROOT密码忘记的解决办法
- Mysql忘记root密码的解决办法
- RedHat Linux9忘记root登陆密码解决办法
- Windows下忘记MySQL数据库root用户密码的解决办法
- linux忘记root密码的解决办法
- mysql忘记root密码的通用的解决办法:
- windows下忘记mysql超级管理员root密码的解决办法
- 忘记root用户密码解决办法
- windows下忘记mysql超级管理员root密码的解决办法(转)
- linux下 mysql 忘记root用户密码解决办法
- linux下 mysql 忘记root用户密码解决办法
- linux下 mysql 忘记root用户密码解决办法
- MySQL忘记root密码解决办法
- mysql数据库忘记ROOT密码时的解决办法
- 忘记CentOS root密码的解决办法