Unable to access database

Hey Everyone –

We’ve been zeroing in on why this is happening and the general issue is that the wp db subcommands use the --no-defaults param which blocks out the custom MySQL config we provide.

There is a solution but we ran into major issues when trying to implement it on Windows so we’re still working on a way to implement this in a way that works across the various environments.

In terms of a workaround, as @kristarella mentioned, you should be able to do some of the basic things within the terminal using the plain mysql command (as opposed to wp db <subcommand> or connect with a SQL client to do the work.

For reference, here are some examples of common things that can be done on the cli. The parameters are using the default from the “Database” tab within Local.

Import DB

Instead of:

wp db import database.sql

Use:

mysql -u root -proot local < database.sql 

Export DB

Instead of:

wp db export

Use:

mysqldump -u root -proot local > database.sql
7 Likes