Centos7.5安裝mysql5.7.24二進(jìn)制包方式部署
一、環(huán)境準(zhǔn)備:
操作系統(tǒng):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二進(jìn)制安裝
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、初始化數(shù)據(jù)
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
4、修改配置文件
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
5、systemd啟動(dòng)MYSQL服務(wù)
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、啟動(dòng)服務(wù)
systemctl restart mysqld systemctl enable mysqld
7、修改mysql root密碼
vim /etc/profile export PATH=$PATH:/app/mysql5.7/bin source /etc/profile mysql -uroot -p alter user 'root'@'localhost' IDENTIFIED BY 'Devops@2018';
總結(jié)
以上所述是小編給大家介紹的Centos7.5安裝mysql5.7.24二進(jìn)制包方式部署,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
MySQL學(xué)習(xí)筆記之?dāng)?shù)據(jù)的增、刪、改實(shí)現(xiàn)方法
這篇文章主要介紹了MySQL學(xué)習(xí)筆記之?dāng)?shù)據(jù)的增、刪、改實(shí)現(xiàn)方法,簡(jiǎn)單介紹了mysql實(shí)現(xiàn)數(shù)據(jù)的增、刪、改相關(guān)語(yǔ)法與使用技巧,需要的朋友可以參考下2016-09-09MySQL Slave 觸發(fā) oom-killer解決方法
這篇文章主要介紹了MySQL Slave 觸發(fā) oom-killer解決方法,需要的朋友可以參考下2016-07-07You have an error in your SQL&
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version2023-02-02在MySQL中使用JOIN語(yǔ)句進(jìn)行連接操作的詳細(xì)教程
這篇文章主要介紹了在MySQL中使用JOIN語(yǔ)句進(jìn)行連接操作的詳細(xì)教程,是MySQL入門學(xué)習(xí)中的基礎(chǔ)知識(shí),需要的朋友可以參考下2015-05-05使用mysql事件調(diào)度器定時(shí)刪除binlog
MySQL5.1.6起Mysql增加了事件調(diào)度器(Event Scheduler),可以用做定時(shí)執(zhí)行某些特定任務(wù),來(lái)取代原先只能由操作系統(tǒng)的計(jì)劃任務(wù)來(lái)執(zhí)行的工作2014-03-03禁止mysql做域名解析(解決遠(yuǎn)程訪問(wèn)mysql時(shí)很慢)
當(dāng)遠(yuǎn)程訪問(wèn)mysql時(shí),mysql會(huì)解析域名,會(huì)導(dǎo)致訪問(wèn)速度很慢2010-04-04