I don't know exactly how to search for this but I want to run a PHP script on my home PC which access the MySQL database on my website. I know to connect to the "localhost" database (which if the script was on my website would be the correct one), but how can I connect to a database on say www (dot) example (dot) com?
Instead of localhost, you'll simply put "www.example.com". You'll need to make sure the MySQL port is open on the server firewall and your local firewall (if they exist). Then you'll need to have access granted to your account from your local Internet IP or set access to be allowed from anywhere for your account in MySQL.
Ok. I thought it would be something like that. Wasn't sure if it would need to end in /localhost or not. Thanks.
Nope. If you have problems doing it, feel free to come back here for help.![]()
Ok, so I did all that, at least to my knowledge, and I still got:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'doineedt_wordpre'@'cpe-xx-xxx-xx-xxx.columbus.res.rr.com' (using password: YES) in.
Under cpanel access host I added my ip from ipchicken. Is that the one I want? I allowed the port 3306 on my firewall on my pc, but my server doesn't have one.
in my cpanel, I have a part named "MySQL Remote" where I register the IP-addresses that may access the server, in the database section (not visible in all skins either)
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks