MySQL Installation

由 avimitin 发布

Download Config

Get .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.

Then use wget to download to your server:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb

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.

Choose MySQL Server

If you don't have any other requirement just use arrow key to choose OK.

Install MySQL-Server

First of all, update apt:

apt 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.

No need to enter root pwd

And a notification about authen plugin will jump out, just choose RECOMMEND way

Take a cup of tea and wait.

Secure Installation

After installing server, we should make a safe configure with this command:

mysql_secure_installation

Follow the guide

Then you will get a new configure page, follow the guide and finish the installation.

Authenticate Plugins

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 auth_socket.

change auth plugin

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


暂无评论

发表评论