• Resolved aaronmehar

    (@aaronmehar)


    Hello,

    Ive recently moved servers to a new provider and now have a web server and a MySQL server but I am having issues with connecting to MySQL.

    As per my header I can not establish a connection, I can connect via command line using the mysql client and can display the database and tables who the details and permissions are correct. I have compared the php modules from the old server and new web server and they match, so I dont think its a module thing, all the files are owned by Apache and have the correct SELinux labels in place. I have the correct IPtables rules in place as well.

    I am lost as to what could be the cause of this issue. Any pointer would be a great help.

    Thanks
    Aaron

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Aaron
    Have you checked your database settings in your wp-config.php file are correct? More details here: http://codex.wordpress.org/Editing_wp-config.php#Set_Database_Name

    Aaron, what is your new provider? This problem often happen to me when I move websites to GoDaddy hosting. Check MySQL hostname in wp-config.php. Some hosts use different hostnames other than localhost.

    Thread Starter aaronmehar

    (@aaronmehar)

    Hi,

    I have triple checked and then double checked again. I have copied and pasted them on the command line (mysql -u notesword -p -h myserver.mydomain.com

    I have a dedicated ESXi server with 2 VMs (Web and MySQL), its with RapidSwitch so its definitely not a hostname issue.

    Thanks for the suggestions though.

    Thread Starter aaronmehar

    (@aaronmehar)

    Hello,

    Are they are other suggestions?

    Perhaps the CentOS and Apache forums are a better place to ask this?

    Did you allow network connections in /etc/my.cnf

    Thread Starter aaronmehar

    (@aaronmehar)

    -_-

    WPRanger – thanks

    I added bind-address to my.conf and can now connect, I didnt think of this as I could use the MySQL client on the webserver to connect, so I was assuming an issue with PHP/Apache so was concentrating in the wrong place.

    Thanks a million WPRanger.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.