简体   繁体   中英

How to make Php application running on Xampp to connect to a remote mysql db?

I have a php application running on XAMPP but I want to connect to a mysql db running on a remote machine(which is also using XAMPP). The application works fine when I connect to the mysqldb instance on my machine. I have changed the configuration files to point to the remote db and have given the correct credentials as well. But I get access denied error.

First I would check the remote database owner / host to make sure they allow external access. Most hosts, especially shared hosting providers, only allow access to scripts run locally and do not allow external access like you are describing.

"Access denied" means you're at least connecting to the remote MySQL instance. Most like you've got a mismatch on the credentials. You may have granted permissions to "user@somehost" on the remote MySQL, but if that machine can't resolve "somehost" via DNS or a Hosts file lookup, it'll have to fall back to checking for a "user@ip.add.re.ss" account.

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