Knowledgebase

wordpress and mysql database in different server

Posted by calvynlee, 10-27-2014, 09:10 AM
hi All, I require some advice by setting up wordpress at Host A and get the Mysql database from HOST B. I had upload a copy of wordpress to HOST A and run the setup wizard, during the section for me to put in db, username and db host, I key in the mysql (as below) I create via HOST B's cpanel Database name: calvynlee_testdb Username name: calvynlee_testdb Database Host: xxx.xxx.xxx.xxx (HOST B IP address) From Host B's Cpanel, I had added HOST A IP and URL I hosted in HOSTA in the remote mysql section Unfortunately when I hit submit, it shows error below: Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at xxx.xxx.xxx.xxx. This could mean your host's database server is down. Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums. Am I miss out any step to make it works?

Posted by net, 10-27-2014, 09:23 AM
Moved > Hosting Security and Technology.

Posted by SAHostKing, 10-27-2014, 09:56 AM
Can you use mysql administrator or mysql workbench to connect to it? What we also noticed from one of our servers was that if you use Config Server Firewall it could be blocking connections from other servers as it thinks it's "Port Scans" - hence this could be a firewall issue. The best way is as stated above is to connect to it via MySQL Workbench and see if that works first. http://dev.mysql.com/downloads/workbench/ Download the free version

Posted by edigest, 10-27-2014, 11:27 AM
Isn't this backwards? You want to setup Remote MySQL server on Host A pointing to Host B.

Posted by calvynlee, 10-27-2014, 11:35 AM
never use before wordbench, and just try it. I see error pop up: failed to connect to mysql at xxx.xxx.xxx.xxx:3306 with user calvynlee_testdb access denied for user 'calvynlee_testdb'@"'xxx.xxx.xxx.xx'(using password: Yes) Is this mean that my HOST B not able to access? How can I get my service provider to unblock if there is any firewall?

Posted by calvynlee, 10-27-2014, 11:39 AM
I am not much idea, but HOST A is my wordpress, HOST B is mysql db I would like to use. my HOST B using cpanel, but HOST A is not, HOST A is AZURE WEBSITE

Posted by edigest, 10-27-2014, 11:50 AM
You can enable remote access outside of CPanel, then. Comment out the 'skip-networking' line, if it exists. Add bind-address=xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is the address of the MySQL server. to /etc/my.cnf. If the IP is 123.123.123.123, it will look like this: [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql # skip-networking bind-address = 123.123.123.123

Posted by datarealm, 10-27-2014, 12:13 PM
If you can telnet to port 3306 and get a mysql prompt then it is NOT a firewall issue. If you don't see a prompt, then it IS a firewall issue. If it is not a firewall issue, then the above error message indicates a permissions issue with the mysql user setup not allowing remote access to the db.

Posted by calvynlee, 10-28-2014, 10:05 AM
Apologize I am not very techie when come to this. Can you assist to elaborate more? Do you mean create a file my.cnf with below coding [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql # skip-networking bind-address = 123.123.123.123 and keep it in /etc ? I ftp to my server, I found nothing in /etc at this moment.

Posted by edigest, 10-28-2014, 01:03 PM
You may want to hire an admin to look into this. Finding the correct file and editing it is easiest done from an SSH login as root (or your favorite sudo user). If you're not familiar with command-line access as root you can cause some serious harm to your server. With that caveat in mind ... The MySQL configuration file is not in the /etc folder in the CPanel user space. my.cnf is found in the top-level /etc directory on CPanel servers. You probably already have the example's first six lines in your /etc/my.cnf file. If the "skip-networking" line exists, comment it out by adding a # to the front of the line. You likely do not have the bind-address configuration, so you will need to add that, substituting the server's main IP in place of 123.123.123.123 from the example. Backup your /etc/my.cnf file before making any changes and restart MySQL after making any changes.

Posted by calvynlee, 10-29-2014, 09:33 AM
My HOST A is windows server by the way. but problem solve now, my HOST B service provider had done some setting at back end, at this moment I have no idea what they done. Currently HOST A able to link HOST B mysql!



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Unixshell Down? (Views: 643)
Protagonist.net down? (Views: 640)


Language:

Client Login

Email

Password

Remember Me

Search