Question

Ghost mySQL Error upon initial installation

Posted May 11, 2021 836 views
GhostDigitalOcean Managed MySQL Database

Ghost was able to start, but errored during boot with: ERACCESSDENIED_ERROR: Access denied for user ‘ghost’@‘localhost’ (using password: YES)

Help: Unknown database error
Suggestion: journalctl -u ghost_mysite-com -n 50

Debug Information:
OS: Ubuntu, v20.04.2 LTS
Node Version: v14.16.1
Ghost Version: 4.5.0
Ghost-CLI Version: 1.17.1
Environment: production
Command: ‘ghost install –auto –db=mysql –dbhost=localhost –dbname=ghost_production –dbuser=ghost –dbpass=2960b401ab89b5b4e10a06d456d0235a058254f9f06f53f6 –dir=/var/www/ghost –start’

Stuck here, any help would be appreciated.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @paolotrulli,

It seems like there is either a typo somewhere in the connection to your database, and most precicly either in your dbname, dbuser or dbpass.

If you try to login into your database like so

mysql -u ghost  -p ghost_production

From your Droplet, are you able to?

Another possibility can be the ghost database user to not have enough permissions for your ghost_production database.

Regards,
KFSys

  • Hi @KFSys

    When I run that command I get an enter password field. However, because this was created from DO automatically, I dont know what the password is. I also tried leaving -p blank and entering ghost_production afterwords but also denied.

    ERROR 1045 (28000): Access denied for user 'ghost'@'localhost' (using password: YES)
    

    I did sudo into mysql and granted permissions

    GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
    

    Also

    ALTER USER 'ghost'@'localhost' IDENTIFIED BY 'YES';
    

    Upon restarting ghost the same error occurred.