mysql遠端訪問

2021-08-02 21:21:13 字數 678 閱讀 5200

mysql預設的bind-address 是127.0.0.1,如果需要遠端訪問,先得檢視mycnf,把bind-address=127.0.0.1改為0.0.0.0。

如果在/etc/mysql/my.cnf中沒找到,可以在去/

etc/mysql/mysql.conf.d/mysql.cnf找找。

#bind-address = 127.0.0.1

bind-address = 0.0.0.0

給改root的訪問ip範圍。
update user set host = '%' where user = 'root';
或者增加一條user.
insert into mysql.user(host,user,password) values("%","root","1234");
grant all privileges on *.* to  'root'@'%' identified by 'passwd' with grant option;
bind-address不能為127.0.0.1,不然怎麼修改許可權也沒用

遠端訪問mysql 程式 遠端訪問MySQL

1.確保server端允許被遠端訪問及防火牆放行。確保server端mysql庫中user表中包含host為client端ip資料條目,另外需要知道user和password內容,若沒有可人為新增 按照常理只要host項中包含 就代表允許任何client訪問,但是我的卻沒有成功,只好新增特定ip 在...

mysql 開啟遠端訪問 遠端訪問

select host,user,password from user 查詢使用者遠端訪問相關資訊 用root使用者登陸,然後 grant all privileges on to 建立的使用者名稱 identified by 密碼 flush privileges 重新整理剛才的內容 格式 gra...

mysql 遠端訪問

報類似這樣的 error 1130 host 192.168.1.3 is not allowed to connect to this mysql server 解決辦法 user表裡host列,表明的是使用者可登陸的計算機名,所以辦法有 1,改表 在localhost的那台電腦,登入mysql後...