Invalid Database: Local

I have started a site using LocalWP. My wp-config.php is this:

define( ‘DB_NAME’, ‘verysecu_wp’ );
define( ‘DB_USER’, ‘root’ );
define( ‘DB_PASSWORD’, ‘root’ );
define( ‘DB_HOST’, ‘localhost’ );

And in LocalWP it says my database name is verysecu_wp

When I open Adminer, it takes me to http://localhost:10010/?username=root&db=local and says invalid Database. If I select the dropdown, I can see the ‘verysecu_wp’ database, and the website etc works fine without having to do anything.

I only came across this problem because I am trying to Export and it just hangs on Exporting Site, presumably because it cannot find the db, yet the site works fine. I have tried renaming in the wp-config.php to no avail.

I have exported the verysecu_wp database on it’s own, but any idea how to fix this?

Hi @Brock

You’ll want to change your config so that your DB_NAME is just Local and then see if that works again.

I’ll try that. Even if I have a db called verysecu_wp?

When I do that I get an error on the website saying Error establishing database connection. Looking at Adminer, I do not have a db called local.

If you adjusted your wp-config.php so that define( ‘DB_NAME’, ‘verysecu_wp’ );
is define( ‘DB_NAME’, ‘local’ ); then you’ll also need to Stop and Start the site so that Local can compile the changes.

I’ve tried that already unfortunately. The site is already stopped when I change the wp-config.php, so I start the site, open the site and it says error establishing database.

As a test are you able to create a new, blank site in Local and access that okay or do you run into any errors?

Just created one and it works fine, loaded the db in Adminer and loads local as expected.

I can’t remember whether I renamed the db to verysecu_wp when I started the site, I must have because it was a fresh site and it would never get that db name

Happy to send over logs over if needed. As I say, it ‘only’ became an issue when I tried to export and it just got stuck on Exporting Site for over 15 minutes.

EDIT: I went onto Adminer and changed the db name back to local. Now working! Thanks for the help!

1 Like

Glad to hear it @Brock! Thank you for following up and letting us know. :green_heart:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.