本文介紹了授予從任何 IP 地址遠程訪問 MySQL 數據庫的權限的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我知道這個命令:
GRANT ALL PRIVILEGES
ON database.*
TO 'user'@'yourremotehost'
IDENTIFIED BY 'newpassword';
但是它只允許我授予一個特定的 IP 地址來訪問這個遠程 MySQL 數據庫.如果我想要它以便任何遠程主機都可以訪問這個 MySQL 數據庫怎么辦?我怎么做?基本上,我將這個數據庫公開,以便每個人都可以訪問它.
But then it only allows me to grant a particular IP address to access this remote MySQL database. What if I want it so that any remote host can access this MySQL database? How do I do that? Basically I am making this database public so everyone can access it.
推薦答案
TO 'user'@'%'
% 是通配符 - 如果需要,您還可以執行 '%.domain.com'
或 '%.123.123.123'
以及類似的操作.
% is a wildcard - you can also do '%.domain.com'
or '%.123.123.123'
and things like that if you need.
這篇關于授予從任何 IP 地址遠程訪問 MySQL 數據庫的權限的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!