-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strictly following the Ubuntu install guide on Ubuntu 22.04 fails, because the root
MySQL user gets created with auth_socket
auth, not a password
#1759
Comments
Some further commentary:
... but obviously you'd need to run that from within a process that's running as root, which seems awkward since you deliberately don't allow Maybe the best approach here is to run the commands to create the Ghost user via the shell using your |
Also ran into this error when using Digital Oceans 1-click droplet. Most of what you said above went straight over my head. Is there a quick fix before someone looks at the bug? |
@carrickspeirs yes - see the instructions in the quote block that I suggest adding to the docs. Basically the fix is:
It's unfortunate we have to do this, though, because it weakens the security of our MySQL install a bit. |
You're right, our docs need work here. We should be able to tidy these up next week 🙂 |
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂 |
Summary
The docs at https://ghost.org/docs/install/ubuntu/:
sudo apt-get install mysql-server
, thenroot
MySQL user's password, thenghost install
as some newly-created Unix user who hassudo
privilege but is not rootAssuming you follow those instructions to the letter and don't do anything extra, this is guaranteed to fail (at least on an Ubuntu 22.04 AWS EC2 instance; I have not tried in other environments).
This is because the
sudo apt-get install mysql-server
installs MySQL with a root user whose "plugin" (slightly odd MySQL terminology that for these purposes we can read as "authentication method") isauth_socket
. This authentication method uses a Unix socket and simply checks that the Unix user trying to authenticate has the same name as the MySQL user they're trying to authenticate as; no password is used.Thus, if you enter
root
as the MySQL username when prompted byghost install
, then no matter what password you enter, you will hit an error like this:I suggest the ideal fix here is to change
Ghost-CLI
so that if the MySQL username specified isroot
and no password is given, it will attempt both the current auth mechanism and then, if that fails, attempt tosudo
and do socket-based auth as root.If that's difficult, we should at least add instructions to the end of the Install MySQL section saying something like this:
Steps to Reproduce
sudo su
to swap to theroot
user.Log file
Okay!
Technical details
This is automatically output by Ghost-CLI if an error occurs, please copy & paste:
Debug Information:
OS: Ubuntu, v22.04.2 LTS
Node Version: v16.19.1
Ghost Version: 5.43.0
Ghost-CLI Version: 1.24.0
Environment: production
Command: 'ghost install'
Bug submission checklist
Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root-password';
to change theroot
user to use password auth. Nonetheless, I still consider the docs as they currently exist to be broken, because they don't instruct you to set a password like this and it's a necessary step.The text was updated successfully, but these errors were encountered: