.deb package from MySQL APT Repo. Need to press Download button first and then click the No thanks, just start my download. button to get the download link.
wget to download to your server:
After finishing the download use
apt to install MySQL
apt install ./mysql-apt-config_0.8.15-1_all.deb
And it will start up a configuration:
USE TAB TO JUMP SELECT, USE SPACE TO CHOOSE, USE ENTER TO CONFIRM, USE ARROWKEY TO MOVE CURSOR.
If you don't have any other requirement just use arrow key to choose OK.
First of all, update
Then install mysql-server:
apt install mysql-server
In this page, you don't need to input your password, the exact way is using MySQL secure tool to input root password. So just left it blank here.
And a notification about authen plugin will jump out, just choose RECOMMEND way
Take a cup of tea and wait.
After installing server, we should make a safe configure with this command:
Then you will get a new configure page, follow the guide and finish the installation.
After installtion u will find out that you don't need password to login MySQL server. This problem had stuck me for a long time, and there is no solution on Google. And after testing many times finally I found out solution.
Generally, the authen plugin you install is
auth_socket , you can check out your plugin with this SQL lines:
USE mysql; SELECT user,plugin FROM user;
And you will see root user is using
With this plugin you will never need a root password. But it will cause many problems. So first of all, we need to change authenticate plugin with this MySQL line:
UPDATE mysql.user SET plugin = 'caching_sha2_password' WHERE user = 'root'
And then exit mysql and redo
mysql_secure_installation. Then all things working well.
Now u have to put correct password