Step 1: Update repository index
sudo apt-get update
Step 2: Install MySQL Server with apt
sudo apt-get install mysql-server
Step 3: Verify installation
mysql --version
(reference version: 14.14)
Step 4: Make security configurations by running the included security script
sudo mysql_secure_installation
Commands:
sudo mysql -u root -p
Start MySQL Shell
systemctl status mysql.service
Check running status
systemctl start mysql
Start MySQL Server
Check authentication method for MySQL users
SELECT user,authentication_string,plugin,host FROM mysql.user;
Change the authentication method for root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Reload grant tables
FLUSH PRIVILEGES;
Recheck authentication method for MySQL users
SELECT user,authentication_string,plugin,host FROM mysql.user;
网友评论