Ghost-CLI Installation Issue: Failing on MySQL Setup – Permissions Problem?

Hi everyone,

I’m trying to set up Ghost using Ghost-CLI following the official documentation (doc.ghost.org/docs/ghost-cli/), but I’m running into a MySQL configuration issue that I can’t seem to resolve.

During installation, when Ghost-CLI attempts to set up MySQL, I get the following error:

✖ Setting up "ghost" MySQL user 
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'ghost'@'localhost' (using password: YES)

I’ve already tried manually creating the database and user in MySQL with:

CREATE DATABASE ghost_db;
CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'securepassword';
GRANT ALL PRIVILEGES ON ghost_db.* TO 'ghost'@'localhost';
FLUSH PRIVILEGES;

Yet, when I run ghost install, it still throws the access denied error. I’ve also checked my config.production.json file, and the database settings match exactly.

Has anyone faced this issue before? Could this be a permission-related problem, or is Ghost-CLI failing to detect the correct MySQL credentials? Any suggestions on debugging this further would be greatly appreciated!

It sounds like a MySQL permission issue. Make sure the database user has the correct privileges (GRANT ALL PRIVILEGES ON your_database.* TO 'your_user'@'localhost';). Also, try running Ghost-CLI with sudo if there are permission restrictions. Are you getting a specific error message?