二进制部署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
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
敏敏张 2020-11-11
暗夜之城 2020-11-11
好记忆也需烂 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13