- sudo apt update
- sudo apt install mysql-server
- sudo mysql_secure_installation
- sudo mysql, then issue the command:
SELECT user,authentication_string,plugin,host FROM mysql.user;
Originally, the root user is authenticated with the "auth_socket
"
plugin.
To configure the root account to authenticate with a
password,
run the following ALTER USER
command.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Replacing the 'password' with a new strong password.
Note that this command will change the root password you set in Step 2.