码迷,mamicode.com
首页 > 数据库 > 详细

二进制部署MySQL5.7

时间:2020-04-29 14:54:06      阅读:72      评论:0      收藏:0      [点我收藏+]

标签:数据库   $path   orm   user   mys   strong   脚本   var   port   

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

标签:数据库   $path   orm   user   mys   strong   脚本   var   port   

原文地址:https://www.cnblogs.com/yanyanqaq/p/12801706.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!