简体   繁体   中英

How can I connect remote mysql db from my local?

When I try to connect to the remote mysql db from my local XAMPP php, it says,

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host
'testhost.testserver.com' (11004) in D:\xampp\htdocs\cvsprojects\test\initdb.php 
on line 24

I am sure the mysql host, user name , password are correct to connect.

Your remote MySQL server must allow remote clients to connect. I Am quoting this from a web page

you need to have remote access privileges to the MySQL server. You must use your client IP address or a %-wildcard in the Host column of the mysql.user table next to your username. For more information on connecting to a remote MySQL server see the MySQL documentation (Security and GRANT topics).

Moreover, make sure your system can access the network your remote server is hosted on. After that its plain simple connection settings or strings as some call it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM