mysql允許root遠程登錄


MySQL 默認不允許遠程以root進行登陸

進入mysql后

mysql>select host, user from user;

+--------------------+------+
| host               | user |
+--------------------+------+
| 127.0.0.1          | root |
| ::1                | root |
| localhost          |      |
| localhost          | root |
| vm\_144\_7\_centos |      |
| vm\_144\_7\_centos | root |
+--------------------+------+

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

+--------------------+------+
| host               | user |
+--------------------+------+
| %                  | root |
| 127.0.0.1          | root |
| ::1                | root |
| localhost          |      |
| vm\_144\_7\_centos |      |
| vm\_144\_7\_centos | root |
+--------------------+------+


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM