-
-
Save ferdousulhaque/d00e98239903b8c5d0edadfae868a0e1 to your computer and use it in GitHub Desktop.
Install MySQL on ubuntu 20.04 and set the root password
This file contains hidden or 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment