二进制部署MySQL5.7

Posted 黄海彦架构师之路

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了二进制部署MySQL5.7相关的知识,希望对你有一定的参考价值。

1.下载MySQL5.7

https://downloads.mysql.com/archives/community/

2.上传压缩包,并解压

mkdir -p /server/tools
cd /server/tools/
tar xf mysql-5.7.20.tar.gz -C /application

3.配置并启动

3.1.制作软链接
ln -s /application/mysql-5.7.20/ /application/mysql
3.2.配置my.cnf
vi /etc/my.cnf
basedir=/application/mysql
datadir=/application/mysql/data
socket=/application/mysql/tmp/mysql.sock
port=3306
server_id=10

log-error=/var/log/mysql.log
log-bin=/data/binlog/my-bin
sync_binlog=1
binlog_format=row

skip_name_resolve
default_storage_engine=innodb
character-set-server=utf8
autocommit=0
[mysql]
socket=/application/mysql/tmp/mysql.sock
default-character-set=utf8
3.3.创建关键目录并设置权限
mkdir -p /application/mysql/tmp /application/mysql/data /data/binlog
chown -R mysql.mysql /application/mysql/ /data/binlog
3.4.初始化数据库
/application/mysql/bin/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data --user=mysql
3.5.复制启动脚本到/etc/init.d/mysqld
cd /application/mysql
cp support-files/mysql.server /etc/init.d/mysqld
3.6.启动数据库
/etc/init.d/mysqld start
netstat -lntup|grep 330
3.7.配置环境变量
echo ‘PATH=/application/mysql/bin/:$PATH‘ >>/etc/profile
tail -1 /etc/profile
source /etc/profile

以上是关于二进制部署MySQL5.7的主要内容,如果未能解决你的问题,请参考以下文章

Centos7.5安装mysql5.7.24二进制包方式部署

Centos7.5安装mysql5.7.24二进制包方式部署(主从复制)

二进制安装MySQL5.7

CDH-cdh5.8.3离线安装--Mysql5.7二进制部署

Centos7.5安装mysql5.7.24二进制包方式部署(keepalived+主从复制)

Centos7部署MySQL 5.7.26二进制版本