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、安裝依賴(lài)包
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)文章
weblogic服務(wù)建立數(shù)據(jù)源連接測(cè)試更新mysql驅(qū)動(dòng)包的問(wèn)題及解決方法
WebLogic是用于開(kāi)發(fā)、集成、部署和管理大型分布式Web應(yīng)用、網(wǎng)絡(luò)應(yīng)用和數(shù)據(jù)庫(kù)應(yīng)用的Java應(yīng)用服務(wù)器,這篇文章主要介紹了weblogic服務(wù)建立數(shù)據(jù)源連接測(cè)試更新mysql驅(qū)動(dòng)包,需要的朋友可以參考下2022-01-01
MySQL中使用CTE獲取時(shí)間段數(shù)據(jù)的技巧分享
在數(shù)據(jù)庫(kù)操作中,獲取特定時(shí)間段的數(shù)據(jù)是一項(xiàng)常見(jiàn)任務(wù),MySQL自從8.0版本開(kāi)始支持CTE(公共表表達(dá)式),使得我們可以更加靈活和高效地處理時(shí)間段數(shù)據(jù),本文小編介紹了MySQL中使用CTE獲取時(shí)間段數(shù)據(jù)的技巧分享,需要的朋友可以參考下2024-08-08
navicat中創(chuàng)建存儲(chǔ)過(guò)程、觸發(fā)器和使用游標(biāo)的簡(jiǎn)單實(shí)例(圖文)
這篇文章主要介紹了navicat中創(chuàng)建存儲(chǔ)過(guò)程、觸發(fā)器和使用游標(biāo)的簡(jiǎn)單實(shí)例,需要的朋友可以參考下2017-02-02
Django連接本地mysql數(shù)據(jù)庫(kù)(pycharm)的步驟
這篇文章主要介紹了Django連接本地mysql數(shù)據(jù)庫(kù)(pycharm)的步驟,本文分步驟給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-09-09
MySQL實(shí)現(xiàn)模糊查詢(xún)的高效方法總結(jié)(附30條優(yōu)化建議)
數(shù)據(jù)庫(kù)SQL優(yōu)化是老生常談的問(wèn)題,在面對(duì)模糊查詢(xún)的時(shí)候又有什么好的優(yōu)化建議呢?這篇文章主要給大家介紹了關(guān)于MySQL實(shí)現(xiàn)模糊查詢(xún)的高效方法,文中還附30條優(yōu)化建議,需要的朋友可以參考下2024-03-03
mysql數(shù)據(jù)類(lèi)型和字段屬性原理與用法詳解
這篇文章主要介紹了mysql數(shù)據(jù)類(lèi)型和字段屬性,結(jié)合實(shí)例形式分析了mysql數(shù)據(jù)類(lèi)型和字段屬性基本概念、原理、分類(lèi)、用法及操作注意事項(xiàng),需要的朋友可以參考下2020-04-04
MySQL實(shí)現(xiàn)向表中添加多個(gè)字段 類(lèi)型 注釋
這篇文章主要介紹了MySQL實(shí)現(xiàn)向表中添加多個(gè)字段 類(lèi)型 注釋方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-04-04
Sql Server數(shù)據(jù)庫(kù)遠(yuǎn)程連接訪(fǎng)問(wèn)設(shè)置詳情
這篇文章主要介紹了Sql Server數(shù)據(jù)庫(kù)遠(yuǎn)程連接訪(fǎng)問(wèn)設(shè)置詳情,文章圍繞主題展開(kāi)詳細(xì)的內(nèi)容戒殺,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-09-09

