Preface: recently made an Ali cloud server to learn about mysql related things. Before the basic understanding of the database only stay in SQL to add, delete and change the search, simple index. For other can be said to be ignorant, while this more activity can learn. Come on in August!

1. Download the connection terminal

I’ve chosen Xshell for non-commercial use. It’s ad-free and very easy to use. Website/all downloads/home school free, then fill in the email will receive download link.

FinalShell or other alternative software can also be used.

2. Download the mysql installation package

To download from mysql official website, click on the tag belowSelect the version you want to install and log in to your Oracle account to download it.

3. Connect to the server

Create a new session in Xshell, enter your server address, and connect. If you want to upload files. You can install the rz command on a new server, after all, it is a bit of a waste of time to open the FTP tool every time.

Yum install rz command

yum install lrzsz -y
Copy the code

If the following figure is displayed, the installation is successful.

4. Installation of mysql

Enter rz to upload the mysql RPM installation file you just downloaded. You can also use the wget command to download directly to the server.

Install mysql repository

rpm -Uvh mysql80-community-release-el8-1.noarch.rpm
Copy the code

Success is shown below

Run the yum module disable mysql command to disable the mysql servier.

yum module disable mysql
Copy the code

Install the mysql service

yum install -y mysql-community-server
Copy the code

If the following information is displayed, the mysql is successfully installed

5. Start the mysql

Execute start command

service mysqld start
Copy the code

Viewing the Startup Status

service mysqld status
Copy the code

If the command output is Active (running), the startup is successful.

Don’t think it’s over at this point, mysql8.0 initializes a default password on first startup.

Run a command to view the password

grep 'temporary password' /var/log/mysqld.log
Copy the code

Log in with the password you just copied

Mysql - uroot - pCopy the code

Change the password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';
Copy the code

If you want to change the password to a simple password, you need to change the password level of mysql.

set global validate_password_policy=0; 
Copy the code

You can modify it according to your own needs and execute the command

set global validate_password_length=1;Copy the code

6. Database remote connection tool recommended

Oracle database with PLSql is pretty good. Before Oracle to Mysql, there was no database tool that was as good as PLSql. Later my friend recommended DBeaver, which is really good and has an Interface like Eclipse. Navicat and baby whales are also good. Depending on personal preference, if you don’t want to use additional database connection tools. IDEA in the own connection tool can also meet the daily development use.

(●’ item ‘for one item)