6
我想通過設置root密碼來保護mysql。 我重置成功root密碼:Mysql(MariaDB 10.0.29):設置root密碼,但是仍然可以不用詢問密碼登錄?
MariaDB [(none)]> select Host, User, Password from mysql.user;
+-----------+------+-------------------------------------------+
| Host | User | Password |
+-----------+------+-------------------------------------------+
| localhost | root | *58319282EAB9E38D49CA25844B73DA62C80C2ABC |
+-----------+------+-------------------------------------------+
1 row in set (0.00 sec)
但是,經過沖洗的權限,重啓MySQL,我仍然可以登錄mysql的(本地主機上),而無需輸入密碼。
[email protected]:/# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.0.29-MariaDB SLE 12 SP1 package
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
如何強制mysql連接時詢問密碼?謝謝 !
Thankyou @Sakura Kinomoto。我做到了,但仍然沒有運氣! – thanhpt
不幸...檢查你的mysql.user表,如果有另一個用戶啓用了插件。也許你用另一行登錄,例如root @% –
'code'MariaDB [(none)]>從mysql.user中選擇Host,User,Password,插件; + ----------- + -------- + --------------------------- ---------------- + -------- + |主機|用戶|密碼|插件| + ----------- + -------- + --------------------------- ---------------- + -------- + | localhost | root | * 58319282EAB9E38D49CA25844B73DA62C80C2ABC | | + ----------- + -------- + --------------------------- ---------------- + -------- + 設置1行(0.00秒)'代碼' 我確信表用戶只有一個記錄(根@localhost),具有空的插件值。 – thanhpt