Install mysql5.7 under CentOS7

1、 Install YUM Repo

Starting from CentOS 7, use MariaDB to replace the default MySQL. Since there is no mysql in the yum source of CentOS7, you need to download the yum repo configuration file from the mysql website.

wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

Then install the repo:

rpm -ivh mysql57-community-release-el7-9.noarch.rpm

After the execution is complete, two repo files mysql-community.repo``mysql-community-source.repo will be generated in the /etc/yum.repos.d/ directory

2、 Install MySQL

Use the yum command to complete the installation

yum install mysql mysql-server mysql-devel

**Start msyql: **

systemctl start mysqld #Start MySQL

Configure MySQL

Get the temporary password during installation:

grep 'temporary password'/var/log/mysqld.log

log in:

mysql -u root -p

Change the password after successful login:

set password=password("yourpassword");

Set security options:

mysql_secure_installation

other settings:

systemctl stop mysqld #Close MySQL
systemctl restart mysqld #Restart MySQL
systemctl status mysqld #View MySQL running status
systemctl enable mysqld #Set boot up
systemctl disable mysqld #Turn off startup

3. Other configuration###

Turn on remote control

MySQL does not enable remote control by default, you must add remote access users

grant all privileges on database name.Table name to created user name(root)@"%" identified by "password"; #data storage name.If the table name is written*.*Representative authorizes all databases

flush privileges; #Refresh the content just now

# Such as:
grant all privileges on *.* to root@"113.64.243.1" identified by "123456789";

@ The following is the client IP address (or host name) that accesses mysql.% represents any client. If localhost is filled in for local access (then this user cannot remotely access the mysql database).

At the same time, you can also set whether to have remote access permissions for existing users.

**Configure the default encoding as utf8: **

vi /etc/my.cnf
# Add to
[ mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'

**Other default configuration file path: **

Configuration file:/etc/my.cnf 
Log file:/var/log//var/log/mysqld.log 
Service startup script:/usr/lib/systemd/system/mysqld.service 
Socket file:/var/run/mysqld/mysqld.pid

Recommended Posts

Install mysql5.7 under CentOS7
Install mysql under Centos 7
Install mysql5.1 under CentOS6.5
Install MySQL under Linux (CentOS 7)
CentOS7.2 install Mysql5.7.13
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
Install mysql under Ubuntu 16.04
Install ActiveMQ under Centos7
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
CentOS 7.2 Yum install MySQL 5.6
Centos7 install Mysql8 tutorial
Centos manually install mysql8
Centos7 install Mysql database
Install Jenkins under Centos 7
Install MariaDB under MariaDB Centos7
Install MySQL under Ubuntu
Install mysql8.0.13 version under Linux CentOS7 system
Install mysql online on centos
centos install mysql through yum
Install MySQL 5.7 under CentOS 7 for middle class children!
Install MySQL 8.x from source code under CentOS7
Install MySQL 8.0.16 on Linux Centos
Install Oracle11gR2 database under CentOS6.9
Install Java JDK8 under CentOS6
Centos6 install mysql 5.7.x series
1.5 Install Centos7
Install MongoDB database under CentOS7
CentOS 6.8 under linux install mongodb
CentOS8 install MySQL8 (pro test)
Install Mesos tutorial under CentOS7
How to install MySQL on CentOS 8
CentOS7 yum install and start mysql
Install and configure keepalived under CentOS 5.9
Compile and install LAMP under Centos 5.2
[Introduction to redis] Install redis under Centos
CentOS 7 install Nginx, PHP, MySQL packages
Install MySql with Docker in CentOS7
Install MySQL on Linux CentOS7 (Windows)
CentOS7 yum install and start mysql
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Install Harbor mirror warehouse under CentOS
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
Install Python3 and ansible under CentOS8
Install the latest OpenCV4.3 under Centos8
Install and use docker under CentOS 6.8
centos7 .*tar package to install MySQL5.7
Install Python3 and Py under CentOS7
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3
Centos6 install Python2.7.13
CentOS install Redmine
Centos7 install Python 3.6.