Cannot export database using WP-CLI Access Denied

What issue or error are you experiencing?

Can’t export (or perform any database-related command) using WP-CLI. No problem connecting to the database with the same wp-config.php credentials using HeidiSQL. I have looked up any number of related issues on this forum and none are Windows-specific and the few related ones offer solutions that are unique to Linux or macOS.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Click “Site shell” link, ensure you’re in the correct folder and enter:

wp db export --add-drop-table

and I get this result:

V:\dev\WordPress\icggallery\app\public>wp db export --add-drop-table
Warning: Failed to get current character set of the posts table. Reason: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

System Details

  • Local Version:
    Version 9.1.0+6719
  • Operating System (OS) and OS version:
    Windows 10

Local Logs

local-logs.zip (630.1 KB)

It looks like you’re using a different drive other than the default. Could there be any permissions hang ups there?

Does this happen even with a new, blank site as well?

I’m not sure why the drive letter/folder location would matter when the error is happening when trying to access the database. I have no problem accessing the database from HeidiSQL or node.js (I am writing an app to port an old Omeka Classic site to WordPress) nor installing plugins or uploading media which I assume require the permissions you mentioned.

It was just a thought @clubside but I’m glad most everything is working for you normally. So does this happen for every site you try including a new, blank site? Or is it just the specific site you’re working on currently?

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