一、环境准备:
操作系统:CentOS Linux release 7.5.1804 (Core)
mysql版本:MysqL-5.7.24-linux-glibc2.12-x86_64.tar.gz
IP:172.16.8.247
二、MysqL5.7二进制安装
1、安装依赖包
yum -y install libaio
2、安装MysqL软件
下载软件包:
https://cdn.MysqL.com//Downloads/MysqL-5.7/MysqL-5.7.24-linux-glibc2.12-x86_64.tar.gz
tar -xvf MysqL-5.7.24-linux-glibc2.12-x86_64.tar.gz -C ../ cd .. mv MysqL-5.7.24-linux-glibc2.12-x86_64/ MysqL5.7 useradd -s /sbin/nologin -M MysqL mkdir -p /app/MysqL5.7/{etc,logs,tmp}
3、初始化数据
bin/MysqLd --initialize --basedir=/app/MysqL5.7/ --datadir=/app/MysqL5.7/data --user=MysqL # bin/MysqLd --initialize --basedir=/app/MysqL5.7/ --datadir=/app/MysqL5.7/data --user=MysqL 2018-11-25T03:03:16.299117Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2018-11-25T03:03:16.946059Z 0 [Warning] InnoDB: New log files created, LSN=45790 2018-11-25T03:03:17.033699Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2018-11-25T03:03:17.089657Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a7fef663-f05e-11e8-b1f5-08002728f0e4. 2018-11-25T03:03:17.090377Z 0 [Warning] Gtid table is not ready to be used. Table 'MysqL.gtid_executed' cannot be opened. 2018-11-25T03:03:17.090784Z 1 [Note] A temporary password is generated for root@localhost: m:fw/7on%>Bh
chown -R MysqL . vim /app/MysqL5.7/etc/my.cnf [MysqLd] daemonize = on user = MysqL port = 3306 basedir = /app/MysqL5.7 datadir = /app/MysqL5.7/data socket = /tmp/MysqL.sock bind-address = 0.0.0.0 pid-file = /app/MysqL5.7/tmp/MysqLd.pid character-set-server = utf8 collation-server = utf8_general_ci max_connections = 2408 log-error = /app/MysqL5.7/logs/MysqLd.log
vim /lib/systemd/system/MysqLd.service [Unit] Description=MysqL Server Documentation=man:MysqLd(8) Documentation=http://dev.MysqL.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=MysqL Group=MysqL Type=forking TimeoutSec=0 PermissionsstartOnly=true ExecStart=/app/MysqL5.7/bin/MysqLd --defaults-file=/app/MysqL5.7/etc/my.cnf LimitNOFILE = 5000 Restart=on-failure RestartPreventExitStartus=1 PrivateTmp=false
6、启动服务
vim /etc/profile export PATH=$PATH:/app/MysqL5.7/bin source /etc/profile MysqL -uroot -p alter user 'root'@'localhost' IDENTIFIED BY 'Devops@2018';
总结
以上所述是小编给大家介绍的Centos7.5安装MysqL5.7.24二进制包方式部署,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程之家网站的支持!