MySQL user/pass issues with Ghost on Ubuntu 20.04

I have tried to install Ghost twice… and I've run into similar issues both times. I am following these directions and I think the problem lies in this step here, wherein I am (I think) creating a mysql user for Ghost to use to access the database:

Now update your user with this command
Replace 'password' with your password, but keep the quote marks!
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Can anyone offer any advice? The problem manifests at the end of the install process, where the command to launch Ghost produces this error:

3) GhostError

Message: Ghost was able to start, but errored during boot with: 
ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
Help: Unknown database error

5 Replies

@sdimbert --

I'm a little rusty at MySQL but, if this is a fresh install of MySQL, there is no root user yet… My best guess would be to change:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

to

CREATE USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

I think ALTER USER expects the USER to be created already.

Hope this helps…

-- sw

I can't even get there!

When I enter sudo mysql, I get the following error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Try:

mysql -u root@localhost -p

You don't need sudo…MySQL has it's own authentication scheme. Try man mysql for explanations of -u and -p.

Also, you may have to start over…changing your procedure to use CREATE USER instead of ALTER USER…so that the MySQL admin password is something you know.

-- sw

P.S. The MySQL admin user does not have to be called root…unless your app requires this. IMHO, it's a good idea to NOT make the MySQL admin be called root…use admin or mysqladmin…this will minimize the confusion in context-switching between the system (where root is always the name of the super-user) and MySQL administration.

Just my $.02…

Dumb question: the mySQL admin user that I'm creating here exists only in mySQL, right? It has nothing to do with system users?

@sdimbert --

There is (typically) a mysql/mysql user/group created in the system when you install MySQL but these are used for file/process ownership/permissions purposes…not anything to do with SQL.

The SQL USER you CREATE/ALTER is for MySQL only.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct