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?
Run PHP Script On Home Machine, Access MySQL of Site
Started by rsnider19, Oct 13 2009 07:04 AM
5 replies to this topic
#1
Posted 13 October 2009 - 07:04 AM
|
|
|
#2
Guest_Jordan_*
Posted 13 October 2009 - 07:08 AM
Guest_Jordan_*
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.
#3
Posted 13 October 2009 - 07:23 AM
Ok. I thought it would be something like that. Wasn't sure if it would need to end in /localhost or not. Thanks.
#4
Guest_Jordan_*
Posted 13 October 2009 - 07:29 AM
Guest_Jordan_*
Nope. If you have problems doing it, feel free to come back here for help. :)
#5
Posted 15 October 2009 - 05:50 AM
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.
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.
#6
Posted 15 October 2009 - 09:49 AM
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
I study Information Systems at Karlstad University when I'm not on CodeCall


Sign In
Create Account


Back to top









