After changin domain WP does not connect to de database, user does…
-
SYSTEM INFORMATION
OS type and version: CentOS Linux 7.9.2009
Webmin version: 1.981
Virtualmin version: 6.17
Related products version: Apache 2.4.6
Related products version: PHP 7.2.24
Related products version: Maria DB 5.5.68I changed the domain of a particular account on a VPS for a new domain name. That worked fine, I tested with a test index.html file
I changed the domain in wp_config.phpdefine(‘DOMAIN_CURRENT_SITE’, ‘newdomain.com’);
I get WordPress error:
Error establishing a database connection
Please note that before changing the domain, WordPress was working fine.
Tested the database user with this script, and is connecting fine to the database:
<?php $link = mysqli_connect('localhost', 'user', 'password', "database"); if (!$link) { die('connection error: ' . mysqli_error()); } echo 'Success connection'; mysqli_close($link); ?>
I updated in table wp_options the registers: siteurl and home with the new domain URL using adminer
I initialized Bind, MariaDB, Apache and even restarted the server
I followed this tutorial to the end, I did not repair the database, it was working fine before the domain change and I did not change anything in WordPress.
How to Fix the Error Establishing a Database Connection in WordPressI do not know what else to do, it was working fine just before changing the domain, and I only changed the domain for the new one, I left the same: administrator username, the home directory, and the user name suffix and group all are the same as in the old domain, database files, everything the same, because is the same hosting account, only changed the domain name, but it is not working.
Any help is very much appreciated
Regards
- The topic ‘After changin domain WP does not connect to de database, user does…’ is closed to new replies.