Closed Thread
Results 1 to 6 of 6

Thread: Run PHP Script On Home Machine, Access MySQL of Site

  1. #1
    rsnider19 is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    34
    Rep Power
    0

    Run PHP Script On Home Machine, Access MySQL of Site

    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?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Run PHP Script On Home Machine, Access MySQL of Site

    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.

  4. #3
    rsnider19 is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    34
    Rep Power
    0

    Re: Run PHP Script On Home Machine, Access MySQL of Site

    Ok. I thought it would be something like that. Wasn't sure if it would need to end in /localhost or not. Thanks.

  5. #4
    Jordan Guest

    Re: Run PHP Script On Home Machine, Access MySQL of Site

    Nope. If you have problems doing it, feel free to come back here for help.

  6. #5
    rsnider19 is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    34
    Rep Power
    0

    Re: Run PHP Script On Home Machine, Access MySQL of Site

    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.

  7. #6
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,081
    Blog Entries
    7
    Rep Power
    41

    Re: Run PHP Script On Home Machine, Access MySQL of Site

    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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. JS script tries to convert my site to site full ajax
    By pierrehs in forum JavaScript and CSS
    Replies: 2
    Last Post: 09-22-2011, 09:12 AM
  2. Arcade Machine eCommerce Web-site For Sale
    By Zethix in forum Sites for Sale
    Replies: 0
    Last Post: 06-04-2011, 04:19 PM
  3. Cannot access intranet site if the poxy was enabled
    By newphpcoder in forum Hosting and Registrars
    Replies: 0
    Last Post: 12-14-2010, 07:40 PM
  4. How to access a password protected site?
    By willem55 in forum PHP Development
    Replies: 4
    Last Post: 07-20-2008, 01:04 PM
  5. proxy script site
    By midnightrose2008 in forum PHP Development
    Replies: 10
    Last Post: 06-16-2008, 08:15 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts