Linux下配置Mysql允許遠端存取詳解,mysql遠端存取

來源:互聯網
上載者:User

Linux下配置Mysql允許遠端存取詳解,mysql遠端存取

操作非常簡單,就5步驟,如下:

1.進入 mysql:

/usr/local/mysql/bin/mysql -u root -p


2.使用 mysql庫 :

use mysql;


3.查看使用者表 :

SELECT `Host`,`User` FROM user;

4.更新使用者表 :

UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;


5.強制重新整理許可權 :

flush privileges;

完成以上步驟即可遠端連線資料庫了,上邊關鍵的一句是

UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;


其中%的意思是允許所有的ip遠端存取,如果需要指定具體的某個ip就寫上具體的ip即可


KO...

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.