Centos7 install Mysql8 tutorial

New features of Mysql8:

Mysql jumped directly from version 5.x to 8.x, my personal view is this:

MySQL 5.5 -> MySQL 5
MySQL 5.6 -> MySQL 6
MySQL 5.7 -> MySQL 7
MySQL 8.0 -> MySQL 8

Of course, it is also possible that Mysql6 and 7 are internally difficult to produce. Since being acquired by Oracle, the vitality is still there. MySQL8 has the following new features:

**Centos7 Mysql8 installation steps: **

1、 Set mysql source

First, you need to enable the MySQL yum repository in the system provided by MySQL. Execute one of the following commands according to your operating system version, here we choose the source of CentOS 7 / RHEL 7

### On CentOS 7/On RHEL 7 system### 
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

### On CentOS 7/On RHEL 6 system### 
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el6-3.noarch.rpm

### On Fedora 30 system### 
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc30-1.noarch.rpm

### On Fedora 29 system### 
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc29-2.noarch.rpm

### On Fedora 28 system### 
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc28-2.noarch.rpm

2、 Install MySQL Community Server

The MySQL yum repository contains multiple repository configurations for multiple MySQL versions. Therefore, first disable all repositories in the mysql repo file

sed -i 's/enabled=1/enabled=0/'/etc/yum.repos.d/mysql-community.repo

Enable centos mysql8 version

## CentOS &RedHat version
yum --enablerepo=mysql80-community install mysql-community-server
## Fedora Systems version
dnf --enablerepo=mysql80-community install mysql-community-server

3、 Start MySQL service

service mysqld start

Use Systemd

systemctl start mysqld.service

4、 Find MySQL root password

After installing MySQL 8.0, a temporary password will be created for the MySQL root user. You can find the generated temporary password in the log file. Password file location: /var/log/mysqld.log

grep "A temporary password"/var/log/mysqld.log

5、 Reset root password

After installing MySQL for the first time, execute the mysql_secure_installation command to protect the MySQL server, including steps to reset the password

mysql_secure_installation
Enter password for user root:

The existing password for the user account root has expired. Please set a newpassword.

New password:
Re-enter newpassword:

Remove anonymous users?(Press y|Y for Yes, any other key for No): y

Disallow root login remotely?(Press y|Y for Yes, any other key for No): y

Remove test database and access to it?(Press y|Y for Yes, any other key for No): y

Reload privilege tables now?(Press y|Y for Yes, any other key for No): y

6、 Add the mysql service to the startup item and start the mysql process

### Using Systemd
systemctl enable mysqld.service
systemctl restart mysqld.service

7、 Open port 3306

If the server has a firewall enabled, remember to enable port 3306

systemctl enable iptables
systemctl start iptables
vim /etc/sysconfig/iptables
## Add to the rules
- A INPUT -p tcp -m state --state NEW -m tcp --dport 3306-j ACCEPT
## Restart firewall
systemctl enable iptables.service
systemctl start iptables.service

If you are using a Tencent Cloud server, you must remember to open the port in the security group

Attached mysql commonly used commands:

Login to mysql

mysql -u username -p

Start mysql

systemctl start mysqld.service

End mysql

systemctl stop mysqld.service

Restart mysql

systemctl restart mysqld.service

Self-start

systemctl enable mysqld.service

The above is the detailed content of the Centos7 installation Mysql8 tutorial. For more information about Centos7 installation Mysql8, please pay attention to other related articles on ZaLou.Cn!

Recommended Posts

Centos7 install Mysql8 tutorial
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL
CentOS install mysql
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Centos install MYSQL8.X tutorial
Install mysql5.7 under CentOS7
Centos install elasticsearch tutorial
CentOS 7.2 Yum install MySQL 5.6
Centos7 install kubernetes tutorial
Centos manually install mysql8
Install mysql under Centos 7
Centos7 install Mysql database
Install mysql5.1 under CentOS6.5
Install mysql online on centos
centos install mysql through yum
Linux Centos7 install redis tutorial
Install MySQL 8.0.16 on Linux Centos
Linux (CentOS7) using RPM to install mysql 8.0.11 tutorial
Install MySQL under Linux (CentOS 7)
vmware install CentOS 7 detailed tutorial
Centos6 install mysql 5.7.x series
1.5 Install Centos7
5.1. CentOS@ install JDK1.8 graphic tutorial
CentOS 7 yum install PHP7.3 tutorial
CentOS8 install MySQL8 (pro test)
Install Mesos tutorial under CentOS7
CentOS7 yum install and start mysql
CentOS Yum compile and install MySQL 5.6
Minimal install JDK 1.8 tutorial in CentOS 7
CentOS 7 install Nginx, PHP, MySQL packages
CentOS8 install jdk8 / java8 tutorial (recommended)
Install MySQL on Linux CentOS7 (Windows)
CentOS7 yum install and start mysql
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
centos7 .*tar package to install MySQL5.7
[Switch] CentOS7 64-bit installation mysql tutorial
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS install Redmine
Centos7 install Python 3.6.
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7