MySQL 開啟遠端連線

2021-08-30 19:33:22 字數 587 閱讀 3826

預設情況下,mysql只允許本地登入,如果要開啟遠端連線,則需要修改/etc/mysql/my.conf檔案。

找到bind-address = 127.0.0.1這一行

改為bind-address = 0.0.0.0即可

1、新建使用者遠端連線mysql資料庫

grant all on *.* to admin@'%' identified by '123456' with grant option; 

flush privileges;

允許任何ip位址(%表示允許任何ip位址)的電腦用admin帳戶和密碼(123456)來訪問這個mysql server。

注意admin賬戶不一定要存在。

2、支援root使用者允許遠端連線mysql資料庫

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

flush privileges;

mysql開啟遠端 mysql 開啟遠端連線

1045,access denied for user root 192.168.100.1 using password yes 開啟資料庫遠端連線即可 1 先在本機使用root使用者登入mysql,然後進行授權。mysql grant all privileges on to root iden...

開啟mysql遠端連線

首先新增使用者 當然也可是使用root使用者 格式 grant 許可權 on 資料庫名.表名 使用者 登入主機 identified by 使用者密碼 grant select,update,insert,delete on to zhxia identified by 123456 或者所有許可權...

開啟mysql遠端連線

在mysql控制台執行 grant all privileges on to root identified by mypassword with grant option 在mysql控制台執行命令中的 root 可以這樣理解 root是使用者名稱,是主機名或ip位址,這裡的 代表任意主機或ip位...