“This is the 15th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

Database installation: In order to better reflect the real development environment, we installed MySQL on the Linux system to simulate the company’s database server. You can choose to build a Linux environment on top of the virtual machine software. Or buy a server to build a Linux environment.

I choose to buy a server here.

Cloud.tencent.com/act/double1…

Next, install MySQL on CentOS

  1. Manually download the mysql installation package

Downloads.mysql.com/archives/co…

After downloading it, upload it to CentOS. Little knowledge:

Uploads and downloads

Cloud.tencent.com/document/pr…

Run the following command to upload files to the Linux lightweight application server

SCP Local file address Lightweight application server account @Lightweight application server instance public IP address/domain name: lightweight application server file address

SCP/home/Inmp0.4. Tar. Gz [email protected]: / home/Inmp0.4 tar. Gz

Run the following command to download the files from the Linux lightweight application server to the local PC

SCP Lightweight as account @Public IP address/domain name of the lightweight as instance: lightweight as file address Local file address

SCP [email protected]: / home/Inmp0.4. Tar. Gz/home/Inmp0.4 tar. Gz

Let’s start unpacking the installation:

  1. Decompress the mysql installation package
Mkdir mysql tar -xvf mysql-5.7.27-1.e17.x86_64. RPM -bundle.tar -c mysql/Copy the code
  1. Installing the Client
CD mysql/ RPM -ivh mysql-community-server-5.7.27-1.e17.x86_64. RMP --force --nodepsCopy the code
  1. Change the default character set of mysql
Vi /etc/my.cnf Add the following information: [mysqld] character-set-server=utf8 collation-server=utf8_general_ci -- Add [client] default-character-set=utf8 at the bottom of the fileCopy the code
  1. Start the mysql service
service mysqld start
Copy the code
  1. Log on to the mysql
Run the following command to query the initial password: cat /var/log/mysqld.log Run the following command to query the initial password: root@localhostCopy the code
  1. Change the mysql login password
set global validate_password_policy=0; set global validate_password_length=1; Set password=password(' password ');Copy the code
  1. Grant remote link permission
Grant all PRIVILEGES on *.* to 'root' @'%' identified by 'password '; // Refresh PRIVILEGES;Copy the code
  1. If Linux is installed on a VM, disable the Linux firewall for remote connection.
systemctl stop firewalld
Copy the code

If you have purchased a cloud server, enable port 3306.

  1. Restarting the mysql service
service mysqld restart
Copy the code

10. Stop the mysql service

service mysqld stop
Copy the code

Mysql is installed. 11. It is recommended that you install MYSQLWorkbench on the client side to link to remote databases. Dev.mysql.com/downloads/w…

Client software such as SQLyog and Navicat can also be used.