Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5540

Migrating remote MySQL servers doesn’t work

$
0
0

Hello,

I installed wordpress on an Apache web server running in a Proxmox container. I also have a remote MySQL server (mysql01, running CentOS 8) with my wordpress database on it, and a MySQL user with the appropriate permissions. I recently created a new MySQL server (mysql02, running Ubuntu 20.04) and imported the wordpress database, and created the same user and granted the same permissions, but when I edit the DB_HOST value in my /etc/wordpress/config-<sitename>.php file, I simply get a
“Error establishing a database connection” message on my blog. Visiting /wp-admin gives a bit more info:

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 192.168.5.240. 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?

Here’s the weird thing – I can remotely connect to the MySQL database from the same server WordPress is running on, using the same credentials: mysql -u wordpress -p -h 192.168.5.240 succeeds.

Are there any logs or places where I can get more detailed information on why WordPress can’t complete the MySQL connection, even though the command-line mysql program can? Or maybe an extra spot I have to change the database IP? Thanks 🙂


Viewing all articles
Browse latest Browse all 5540

Trending Articles