How to install MySQL 8.0.13 in Alibaba Cloud CentOS 7

How to install MySQL 8.0.13 in Alibaba Cloud CentOS 7

1. Download the MySQL installation package (there is a trick here. Maybe when I write this, the version is still the old version you see. If it is not 8.0, you can download the new version according to this)

First enter the official website

Combining the two together will give you the latest version.

so

[root@h1 ~]# rpm -ivh http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

2. Install MySQL

[root@localhost ~]# yum install -y mysql-server
or [root@localhost ~]# yum install mysql-community-server

If the following is displayed, the installation is successful

Complete!

3. Set up mysql

Set up Mysql startup

[root@localhost ~]# systemctl enable mysqld.service

Check whether the startup autostart is installed

[root@localhost ~]# systemctl list-unit-files | grep mysqld

If the following content is displayed, the automatic startup installation has been completed

mysqld.service enabled

Set up service

[root@localhost ~]# systemctl start mysqld.service

A brief note is needed here: the password modification method of MySQL 8.0 version is different from that of previous versions

4. Log in to modify the mysql password

View the default password of mysql

[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log

Log in to MySQL for the first time and enter the account and default password

[root@localhost ~]# mysql -uroot -p

Modify current password

#MySQL8.0 requires a combination of uppercase and lowercase letters, numbers, and special characters to modify the passwordmysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; 

Official password modification instructions

5. The command is executed immediately and takes effect

mysql>flush privileges;

Supplement: External network/client access issues, such as navicat connection

Solution: Log in to MySQL and modify the host of the user logged in in the user table  

#Remotely set mysql> use mysql;
mysql> update user set host='%' where user='root';
#Authorize the user name's permissions and grant any host the permission to access data mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

Then after everything is ok, error 2059 appears again, because the security port is not open

After the mysql login user password is set, you need to develop a security group port, and it seems that the above is not mysql8.0 version, because the encryption method of version 8.0 has changed. The encryption rule after mysql8 is caching_sha2_password, so we need to change the encryption rule of mysql user login to mysql_native_password, and you need to turn off the firewall, and then set a security port (note that since the user was changed before, here @"%")

mysql> ALTER USER 'root'@'%' IDENTIFIED BY 'Root!!2018' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.03 sec)

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Root!!2018'; 
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

1. sudo systemctl stop firewalld.service stop firewalld.service

2. Disable startup: sudo systemctl disable firewalld.service

In addition, you need to add a new rule to open port 3306 in the Alibaba Cloud console firewall.

Then connect again, ok

Supplement : Database related operations

#Start mysql
systemctl start mysqld.service
 
#End systemctl stop mysqld.service
 
#Restart systemctl restart mysqld.service
 
#Start automatically at boot time systemctl enable mysqld.service 

This is the end of this article about the steps to install MySQL 8.0.13 in Alibaba Cloud centos7. For more information about installing MySQL 8.0.13 in centos7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed tutorial on installing mysql8.0.22 on Alibaba Cloud centos7
  • Detailed tutorial on installing MySQL database on Alibaba Cloud Server
  • Tutorial on installing MYSQL8.0 on Alibaba Cloud ESC
  • Alibaba Cloud ECS cloud server (linux system) cannot connect remotely after installing MySQL (pitfall)
  • Detailed explanation of how to install MySQL on Alibaba Cloud
  • Tutorial on installing MySQL on Alibaba Cloud Centos 7.5
  • How to solve the 2002 error when installing MySQL database on Alibaba Cloud
  • Detailed explanation on how to install MySQL database on Alibaba Cloud Server

<<:  Solution to the problem that Vue binding objects and array variables cannot be rendered after changing

>>:  Why I recommend Nginx as a backend server proxy (reason analysis)

Recommend

isPrototypeOf Function in JavaScript

Table of contents 1. isPrototypeOf() Example 1, O...

MySQL query specifies that the field is not a number and comma sql

Core SQL statements MySQL query statement that do...

Introduction to JavaScript conditional access attributes and arrow functions

Table of contents 1. Conditional access attribute...

Implementation of docker view container log command

Why should we read the log? For example, if the c...

How to use explain to query SQL execution plan in MySql

The explain command is the primary way to see how...

MySQL online DDL tool gh-ost principle analysis

Table of contents 1. Introduction 1.1 Principle 1...

Vue simple implementation of turntable lottery

This article shares the specific code of Vue to s...

HTML Tutorial: HTML horizontal line segment

<br />This tag can display a horizontal line...

The latest virtual machine VMware 14 installation tutorial

First, I will give you the VMware 14 activation c...

Get the calculated style in the CSS element (after cascading/final style)

To obtain the calculated style in a CSS element (t...

Docker network mode and configuration method

1. Docker Network Mode When docker run creates a ...

Javascript implements simple navigation bar

This article shares the specific code of Javascri...