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

Font Treasure House 50 exquisite free English font resources Part 1

Designers have their own font library, which allo...

JavaScript to achieve drop-down menu effect

Use Javascript to implement a drop-down menu for ...

Detailed Example of MySQL curdate() Function

MySQL CURDATE Function Introduction If used in a ...

How to solve "Unable to start mysql service error 1069"

Today, when I was on the road, a colleague sent m...

Detailed explanation of the life cycle of Angular components (Part 2)

Table of contents 1. View hook 1. Things to note ...

js to realize a simple disc clock

This article shares the specific code of js to im...

The meaning and calculation method of QPS and TPS of MySQL database

When doing DB benchmark testing, qps and tps are ...

Simple writing of MYSQL stored procedures and functions

What is a stored procedure Simply put, it is a se...

Example of how to adapt the Vue project to the large screen

A brief analysis of rem First of all, rem is a CS...

Solve the problem of IDEA configuring tomcat startup error

The following two errors were encountered when co...

A brief discussion on creating cluster in nodejs

Table of contents cluster Cluster Details Events ...

MySql quick insert tens of millions of large data examples

In the field of data analysis, database is our go...

How to install MySQL 5.7.28 binary mode under CentOS 7.4

Linux system version: CentOS7.4 MySQL version: 5....

Detailed explanation of the use of MySQL group links

Grouping and linking in MYSQL are the two most co...

Tutorial on installing jdk1.8 on ubuntu14.04

1. Download jdk download address我下載的是jdk-8u221-li...