本地mysql設定遠端連線

2021-08-03 08:22:12 字數 1242 閱讀 3824

一、允許root使用者在任何地方進行遠端登入,並具有所有庫任何操作許可權,

具體操作如下:

在本機先使用root使用者登入mysql: mysql -u root -p"youpassword" 進行授權操作:

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

過載授權表:

flush privileges;

退出mysql資料庫:

exit

二、允許root使用者在乙個特定的ip進行遠端登入,並具有所有庫任何操作許可權,具體操作如下: 在本機先使用root使用者登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant all privileges on *.* to root@"172.16.16.152" identified by "youpassword" with grant option; 過載授權表: flush privileges; 退出mysql資料庫: exit

三、允許root使用者在乙個特定的ip進行遠端登入,並具有所有庫特定操作許可權,具體操作如下: 在本機先使用root使用者登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant select,insert,update,delete on *.* to root@"172.16.16.152" identified by "youpassword"; 過載授權表: flush privileges; 退出mysql資料庫: exit

四、刪除使用者授權,需要使用revoke命令,具體命令格式為: revoke privileges on 資料庫[.表名] from user-name; 具體例項,先在本機登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant select,insert,update,delete on test-db to test-user@"172.16.16.152" identified by "youpassword"; 再進行刪除授權操作: revoke all on test-db from test-user; ****注:該操作只是清除了使用者對於test-db的相關授權許可權,但是這個「test-user」這個使用者還是存在。 最後從使用者表內清除使用者: delete from user where user="test-user"; 過載授權表: flush privileges; 退出mysql資料庫: exit

mysql遠端連線設定 MySQL遠端連線設定

這只是乙個簡單mysql設定。但很多圖簡單,卻忽略了安全性。所以對設定中的細節和含義需要弄到清清楚楚才行。這只是乙個簡單mysql設定。但很多圖簡單,卻忽略了安全性。所以對設定中的細節和含義需要弄到清清楚楚才行。mysql遠端連線的設定問題 下面是步驟 1 登陸本地的mysql server mys...

mysql 設定遠端連線

授權法 grant select,insert,update,delete,create,drop on tablename.to username localhost identified by password 注意 tablename 你自己資料庫的名字,username 連線庫使用者名稱,l...

mysql設定遠端連線

1,開啟mysql遠端連線 1,獲取root許可權 sudo i 2,cd到配置檔案所在路徑 cd etc mysql mysql.conf.d 3,vi mysqld.cnf bind address 127.0.0.1 瀏覽模式 a 插入模式 esc 瀏覽模式 shift 命令列模式 wq 儲存...