wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm

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

vim mysql-community.repo

把要用的版本enable成1,其他成0

[mysql56-community]

name=MySQL 5.6 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

yum list mysql-community-server

yum install mysql-community-server

改/etc/my.cnf

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

character-set-server=utf8mb4

port=5391

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

# Recommended in standard MySQL setup

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

sort_buffer_size=2M

join_buffer_size=4M

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[mysql]

default-character-set=utf8mb4

你可能感兴趣的:(始)