MySQL 测试远程数据库访问主机
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10901335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Test Remote Database Access Host
提问by Philip Kirkbride
I've set up my Remote Database Access Host, on my web hosting cpanel, enabling my home computer IP address to access the online database.
我已经在我的网络托管 cpanel 上设置了我的远程数据库访问主机,使我的家庭计算机 IP 地址能够访问在线数据库。
To the best of my knowledge it should be working, but I'm not 100% sure.
据我所知,它应该可以工作,但我不是 100% 确定。
Is there a quick way I can connect to the database from command promptto make sure its allowing access from my IP address?
有没有一种快速的方法可以从命令提示符连接到数据库,以确保它允许从我的 IP 地址访问?
回答by Packet Tracer
use mysql client, if you have it installed it's quite easy to access a remote host
使用 mysql 客户端,如果你安装了它,访问远程主机很容易
mysql -hyour_ddbb_server_ip -uyour_user -pyour_password your_database_name
or
或者
mysql -h your_ddbb_server_ip -u your_user -p your_database_name
*note that in the first option there are no blank spaces between parameter option and its value
*请注意,在第一个选项中,参数选项与其值之间没有空格
*your_database_name is optional
*your_database_name 是可选的