This topic is locked
[SOLVED]

 connect to remote MySQL database

7/22/2011 1:56:40 PM
PHPRunner General questions
D
dougperk author

I am a newbie wit PHPRunner and am encountering difficulties connecting to remote MySQL database via PHP.

I followed instructions of:

  1. Uploaded phprunner.php to website.
  2. Used browser to access http:/www/mydomainname/phprunner.php
  3. Connection screen appeared and I logged in and selected datbase.
  4. The schema appeared.
    I returned to local install of PHPRunner
  5. Entered Host name
  6. Entered User
  7. Entered Password
  8. Checkmarked "Connect using PHP"
  9. Entered URL: http://mydomainname/phprunner.php
    Upon clicking 'Connect', I receive following error.

    "Unable to connect to the database. Host '50.23.53.240' is not allowed to connect to this MySQL server"
    What must I do to resolve this problem?
    Doug

F
FunkDaddy 7/22/2011

Doug,
Are you sure your MySQL DB is configured to allow remote connections?
If your web server is a windows machine you can try this to enable the remote connection on port 3306:
From CMD line to enable MySQL remote acces:

C:\>netsh advfirewall firewall add rule name="MySQL Server" action=allow protocol=TCP dir=in localport=3306
You can also look at these posts:
http://forums.techguy.org/software-development/623379-solved-how-enable-remote-access.html
and
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
Also make sure that the user connecting to the DB has the right privileges. As a general rule you must identify that user with a 'whateveryourusername@%",note the @ symbol identifies it as a remote user type. You must overtly declare that as a user with rights to your DB using myphpadmin or something like Navicat (I highly recommend Navicat by the way).
Cheers,