mysql中的root密碼忘記的解決辦法
讓mysql不載入許可權表,命令:mysqld --skip-grant-tables
命令:mysqld --skip-grant-tables(windows)
mysqld_safe --skip-grant-tables user=mysql或者/etc/init.d/mysql start --mysqld --skip-grant-tables (linux)
Windows平臺例子:
C:\Users\duansf>mysqld --skip-grant-tables
開啟另外一個命令視窗,進入mysql的互動介面
C:\Users\duansf>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
用update語句重置root密碼。
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.07 sec)
mysql> use mysql
Database changed
mysql> update user set Password=password('123456') where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.24 sec)
重新登陸驗證密碼修改是否成功
C:\Users\duansf>mysql -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.5.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
命令:mysqld --skip-grant-tables(windows)
mysqld_safe --skip-grant-tables user=mysql或者/etc/init.d/mysql start --mysqld --skip-grant-tables (linux)
Windows平臺例子:
C:\Users\duansf>mysqld --skip-grant-tables
開啟另外一個命令視窗,進入mysql的互動介面
C:\Users\duansf>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
用update語句重置root密碼。
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.07 sec)
mysql> use mysql
Database changed
mysql> update user set Password=password('123456') where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.24 sec)
重新登陸驗證密碼修改是否成功
C:\Users\duansf>mysql -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.5.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-1992853/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 忘記root密碼解決辦法MySql密碼
- MySql5.5忘記root密碼的解決辦法MySql密碼
- [分享] CentOS 6.3忘記root密碼的解決辦法CentOS密碼
- RHEL-6忘記root密碼的解決辦法密碼
- MySQL 忘記root密碼的解決方法MySql密碼
- windows下mysql忘記root密碼的解決方法WindowsMySql密碼
- linux下mysql的root密碼忘記解決LinuxMySql密碼
- linux忘記mysql root密碼的解決方法LinuxMySql密碼
- mysql丟失root密碼的解決辦法MySql密碼
- 【問題處理】MySQL忘記root密碼的處理辦法MySql密碼
- CentOS 6.5忘記root密碼的解決辦法(CentOS輸入密碼提示login incorrect)CentOS密碼
- mysql忘記root密碼MySql密碼
- Mysql 5.7忘記root密碼怎麼辦MySql密碼
- [Mysql]mysql忘記ROOT密碼MySql密碼
- iPhone忘記訪問限制密碼的解決辦法 密碼忘記了怎麼辦?iPhone密碼
- 忘記開機密碼怎麼辦 忘記電腦開機密碼的解決辦法密碼
- 解決AIX忘記root密碼的問題AI密碼
- 雲伺服器解決“MySQL忘記密碼”問題的辦法伺服器MySql密碼
- SUSE root密碼忘記解決方法密碼
- MySQL 忘記口令的解決辦法MySql
- MySql5.5忘記root密碼怎麼辦MySql密碼
- mysql 5.7忘記root密碼MySql密碼
- mysql root 密碼忘記windowsMySql密碼Windows
- mac蘋果電腦忘記密碼的解決辦法Mac蘋果密碼
- 華為路由器忘記密碼的解決辦法路由器密碼
- Linux平臺MySQL忘記root密碼解決方案LinuxMySql密碼
- mysql誤刪root使用者或者忘記root密碼解決方法MySql密碼
- linux系統root密碼遺忘的情況下的解決辦法Linux密碼
- MYSQL修改密碼和忘記ROOT密碼MySql密碼
- MySQL忘記root密碼後的處理MySql密碼
- MySQL的root密碼忘記或丟失的解決方法一例MySql密碼
- mysql忘記root密碼恢復MySql密碼
- MySQL 5.7修改忘記root密碼MySql密碼
- Linux root密碼丟失的解決辦法Linux密碼
- mysql忘記密碼解決方案MySql密碼
- mysql密碼忘記解決方案MySql密碼
- 寶塔皮膚忘記賬號和密碼的解決辦法密碼
- Windows和Linux環境下忘記MySQL連線密碼的解決辦法WindowsLinuxMySql密碼