亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mysql忘記root密碼怎么處理

發布時間:2020-05-21 15:02:13 來源:網絡 閱讀:203 作者:三月 欄目:MySQL數據庫

下面一起來了解下mysql忘記root密碼怎么處理,相信大家看完肯定會受益匪淺,文字在精不在多,希望mysql忘記root密碼怎么處理這篇短內容是你想要的。

mysql忘記了超級用戶管理密碼,可以利用重新啟動mysql進程的時候帶 --skip-grant-tables參數來啟動數據庫,并空密碼登錄。這個就是相當于是數據庫第一次啟動的時候。隨后可以查看mysql.user表里面的超級用戶,以及修改超級用戶的密碼

1# 關閉MYSQL instance,或者殺死進程

2# 重新啟動mysql,帶--skip-grant-tables語句

[mysql@mysql01 my.cnf.d]$ mysqld_safe --defaults-file='/data/mysqldata/3306/my.cnf'  --skip-grant-tables &
[1] 32530
[mysql@mysql01 my.cnf.d]$ 180828 19:02:13 mysqld_safe Logging to '/data/mysqldata/3306/data/../mysql-error.log'.
180828 19:02:13 mysqld_safe Starting mysqld daemon with databases from /data/mysqldata/3306/data

[mysql@mysql01 my.cnf.d]$ 

3# 空密碼登錄MySQL

[mysql@mysql01 my.cnf.d]$ msyql -S /data/mysqldata/3306/mysql.sock 
bash: msyql: command not found...
[mysql@mysql01 my.cnf.d]$ mysql -S /data/mysqldata/3306/mysql.sock 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.31-log Source distribution

Copyright (c) 2000, 2016, 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.

(root@localhost)[(none)]> 

4# 修改mysql.user表

(root@localhost)[(none)]> 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
(root@localhost)[mysql]> 
(root@localhost)[mysql]> select user,host,password from user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *A0F874BC7F54EE086FCE60A37CE7887D8B31086B |
+------+-----------+-------------------------------------------+
1 row in set (0.00 sec)

(root@localhost)[mysql]> update user set password=password('password123') where user='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

(root@localhost)[mysql]> 

5# 正常關閉數據庫

[mysql@mysql01 my.cnf.d]$ mysqladmin -S /data/mysqldata/3306/mysql.sock -uroot -p'password123' shutdown
Warning: Using a password on the command line interface can be insecure.
180828 19:04:54 mysqld_safe mysqld from pid file /data/mysqldata/3306/mysql.pid ended
[1]+  Done                    mysqld_safe --defaults-file='/data/mysqldata/3306/my.cnf' --skip-grant-tables
[mysql@mysql01 my.cnf.d]$ 

6# 正常開啟數據庫

[mysql@mysql01 my.cnf.d]$ mysqld_safe --defaults-file='/data/mysqldata/3306/my.cnf'  &
[1] 33094
[mysql@mysql01 my.cnf.d]$ 180828 19:05:04 mysqld_safe Logging to '/data/mysqldata/3306/data/../mysql-error.log'.
180828 19:05:04 mysqld_safe Starting mysqld daemon with databases from /data/mysqldata/3306/data

[mysql@mysql01 my.cnf.d]$

7# 正常登錄數據庫

[mysql@mysql01 my.cnf.d]$ mysql -uroot -S '/data/mysqldata/3306/mysql.sock' -p'password123'
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.31-log Source distribution

Copyright (c) 2000, 2016, 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.

(root@localhost)[(none)]> 

至此mysql的root密碼修改完成

看完mysql忘記root密碼怎么處理這篇文章后,很多讀者朋友肯定會想要了解更多的相關內容,如需獲取更多的行業信息,可以關注我們的行業資訊欄目。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

辽宁省| 毕节市| 视频| 城口县| 耒阳市| 抚宁县| 淮安市| 荥阳市| 马公市| 花莲县| 肇庆市| 饶阳县| 赫章县| 和林格尔县| 清苑县| 辉南县| 开江县| 宜兰县| 安吉县| 吉水县| 灵武市| 阿克苏市| 苍南县| 荆门市| 岳阳县| 建始县| 炎陵县| 瑞金市| 扬州市| 房产| 山阴县| 收藏| 兴山县| 南康市| 仙桃市| 原平市| 盐津县| 孟津县| 克什克腾旗| 巢湖市| 乌恰县|