Last active
September 23, 2024 09:40
-
-
Save alexwebgr/e438dcbb1eba91af8131736cfbfe9b80 to your computer and use it in GitHub Desktop.
Install MySQL on ubuntu 20.04 and set the root password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Completely remove any previous config | |
sudo apt remove --purge mysql* | |
sudo apt autoremove | |
sudo find / -iname mysql | |
# install the server | |
sudo apt update | |
sudo apt install mysql-server | |
# run the wizard | |
sudo mysql_secure_installation | |
sudo mysql | |
mysql> use mysql; | |
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user; | |
# enable password login | |
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password'; | |
mysql> FLUSH PRIVILEGES; | |
mysql> exit; | |
# should be able to login with password now | |
mysql -u root -p | |
Enter password: | |
mysql> |
If I'm interpreting the error message correctly, it says you are setting
the password
…On Sat, Aug 26, 2023, 17:58 jamal boussouf ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I still get this error:
Error: Access denied for user 'root'@'localhost' (using password: NO)
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/alexwebgr/e438dcbb1eba91af8131736cfbfe9b80#gistcomment-4672520>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2JR35QOHRFKUMMP4PPQBTXXIFI5BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTAMRZGQ2DENBWU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I still get this error:
Error: Access denied for user 'root'@'localhost' (using password: NO)