So my files got deleted, but my old MySQL database is still there with posts. I have reinstalled WordPress and new WordPress installation is using new, empty database. How can i make it use old database?
I have tried changing DB_NAME in wp-config.php but then i just get " Error establishing a database connection" on my site…
Do I need to change DB_PASSWORD too and where can i find password for old database?
You should then be able to see the actual error message, and compare those against the common errors in this article:
Normally, your account username and password are also your MySQL username and password, meaning you have one user/password for all databases.
Softaculous muddies this a bit by creating its own users and passwords. If you’re migrating websites, you probably can’t use those credentials as they only have access to the specific database they were created for, not all databases in the account (I think).
So you’ll want to remove all the existing database credentials and enter the username, password, hostname and database name shown in the client area. Please don’t go mix and match credentials, it’s going to end badly.
Warning : mysqli_real_connect(): (HY000/1045): Access denied for user ‘34093412’@‘192.168.0.5’ (using password: YES) in /home/vol2_8/epizy.com/epiz_34093412/htdocs/wp-includes/class-wpdb.php on line 2035
Deprecated : mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/vol2_8/epizy.com/epiz_34093412/htdocs/wp-includes/class-wpdb.php on line 2067
Warning : mysql_connect(): Access denied for user ‘34093412’@‘192.168.0.5’ (using password: YES) in /home/vol2_8/epizy.com/epiz_34093412/htdocs/wp-includes/class-wpdb.php on line 2067
That username is incorrect. It should be epiz_34093412.
Please make sure to use the EXACT credentials shown in the client area.
Another thing you could try is to export the current database, reinstall WordPress with a fresh database, and then import the backup of your old database into it.
Then you only need to change the table prefix in the wp-config.php of the new installation without having to touch the login details.
wp-admin works, all my old posts are there, so it’s probably theme error, I’m gonna install old theme on new Wordpress.
I have no idea why dashboard credentials work with old database but not with new database but it seems to work.
Thank you for the help
If WordPress is configured to use a theme that’s not installed, it will just output a blank page. That’s normal. You can reinstall the theme from wp-admin or switch to a default theme to verify your site works.
The MySQL credentials in the client area should work with all databases on the account. But you do need to use the right credentials.