mysql数据库5.7版本部署
1.安装前准备:
(mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz 二进制安装包 + centos7.4系统,有yum环境,可以在www.mysql.com官网下载)
2.开始安装
shell yum install libaio
shell groupadd mysql
shell useradd -r -g mysql -s /bin/false mysql
shell cd /usr/local
shell tar zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
shell ln -s mysql-5.7.22-linux-glibc2.12-x86_64 mysql
shell cd mysql
shell cp support-files/mysql.server /etc/rc.d/init.d/mysql.server
3.创建mysql数据库的库文件存放目录
mkdir -p /disk1/mysql/data
mkdir -p /disk1/mysql/securefile
chown -R mysql:mysql /disk1/mysql/
4.编辑/etc/my.cnf文件
[client]
port=3306
socket=/disk1/mysql/mysql.sock
default-character-set=utf8
[mysqld]
user=mysql
basedir=/usr/local/mysql
datadir=/disk1/mysql/data
socket=/disk1/mysql/mysql.sock
pid-file=/disk1/mysql/mysqld.pid
symbolic-links=1
server-id=1
secure-file-priv=/disk1/mysql/securefile
lower_case_table_names=1
log_timestamps=SYSTEM
#default-storage-engine = InnoDB
#autocommit = on
#transaction-isolation