Centos7 安裝 Mysql8教程
Mysql8新特性:
Mysql從5.x版本直接跳躍到8.x,我個(gè)人是這么看的:
MySQL 5.5 -> MySQL 5
MySQL 5.6 -> MySQL 6
MySQL 5.7 -> MySQL 7
MySQL 8.0 -> MySQL 8
當(dāng)然也有可能是Mysql6、7內(nèi)部難產(chǎn)了-_-,自從被Oracle收購(gòu)后,活力依舊在,mysql8有以下新特性:
- MySQL 文檔存儲(chǔ)
- 默認(rèn) utf8mb4 編碼
- JSON 增強(qiáng)
- CTEs(譯者注:Common Table Expresssions 公共表格表達(dá)式)
- 窗口函數(shù)
- 降序索引
- 更好的優(yōu)化器消費(fèi)模型
- MySQL 服務(wù)器組件
- GIS(譯者注:Geographic Information System 地理信息系統(tǒng)) 提升
- InnoDB 引擎的 NO WAIT 和 SKIP \ LOCKED 選項(xiàng)
Centos7 Mysql8安裝步驟:
1、設(shè)置mysql源
首先,您需要在MySQL提供的系統(tǒng)中啟用MySQL yum存儲(chǔ)庫(kù)。 根據(jù)您的操作系統(tǒng)版本執(zhí)行以下命令之一,這里我們選擇CentOS 7 / RHEL 7的源
###在CentOS 7 / RHEL 7系統(tǒng)上### rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm ###在CentOS 7 / RHEL 6系統(tǒng)上### rpm -Uvh https://repo.mysql.com/mysql80-community-release-el6-3.noarch.rpm ###在Fedora 30系統(tǒng)上### rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc30-1.noarch.rpm ###在Fedora 29系統(tǒng)上### rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc29-2.noarch.rpm ###在Fedora 28系統(tǒng)上### rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc28-2.noarch.rpm
2、安裝MySQL Community Server
MySQL yum存儲(chǔ)庫(kù)包含用于多個(gè)MySQL版本的多個(gè)存儲(chǔ)庫(kù)配置。 因此,首先禁用mysql repo文件中的所有存儲(chǔ)庫(kù)
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
啟用centos mysql8版本
## CentOS & RedHat 版本 yum --enablerepo=mysql80-community install mysql-community-server ## Fedora Systems 版本 dnf --enablerepo=mysql80-community install mysql-community-server
3、啟動(dòng)MySQL服務(wù)
service mysqld start
使用Systemd
systemctl start mysqld.service
4、查找MySQL root密碼
安裝MySQL 8.0后,將為MySQL根用戶(hù)創(chuàng)建一個(gè)臨時(shí)密碼。 您可以在日志文件中找到生成的臨時(shí)密碼。密碼文件位置:/var/log/mysqld.log
grep "A temporary password" /var/log/mysqld.log
5、重置root密碼
首次安裝MySQL后,執(zhí)行mysql_secure_installation命令以保護(hù)MySQL服務(wù)器,包含重置密碼步驟
mysql_secure_installation
Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
6、mysql 服務(wù)加入開(kāi)機(jī)啟動(dòng)項(xiàng),并啟動(dòng)mysql進(jìn)程
### Using Systemd systemctl enable mysqld.service systemctl restart mysqld.service
7、開(kāi)放3306端口
如果服務(wù)器開(kāi)啟了防火墻,記得開(kāi)啟3306端口
systemctl enable iptables systemctl start iptables vim /etc/sysconfig/iptables ##規(guī)則中加入 -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT ##重啟防火墻 systemctl enable iptables.service systemctl start iptables.service
如果使用的騰訊云的服務(wù)器,一定記得開(kāi)啟安全組里的端口
附mysql常用命令:
登錄mysql
mysql -u username -p
啟動(dòng)mysql
systemctl start mysqld.service
結(jié)束mysql
systemctl stop mysqld.service
重啟mysql
systemctl restart mysqld.service
開(kāi)機(jī)自啟
systemctl enable mysqld.service
以上就是Centos7 安裝 Mysql8教程的詳細(xì)內(nèi)容,更多關(guān)于Centos7 安裝 Mysql8的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
- linux(Centos7)下安裝mysql8.0.18的教程圖解
- centos7上mysql8.0rpm方式安裝教程圖解
- CentOS7.4 源碼安裝MySQL8.0的教程詳解
- CentOS7.5 安裝 Mysql8.0.19的教程圖文詳解
- CentOS7.6安裝MYSQL8.0的步驟詳解
- mysql8.0.23 linux(centos7)安裝完整超詳細(xì)教程
- CentOS7版本安裝Mysql8.0.20版本數(shù)據(jù)庫(kù)的詳細(xì)教程
- Centos7下安裝MySQL8.0.23的步驟(小白入門(mén)級(jí)別)
- CentOS7安裝MySQL8的超級(jí)詳細(xì)教程(無(wú)坑!)
相關(guān)文章
linux中數(shù)據(jù)庫(kù)的定時(shí)備份
這篇文章主要介紹了linux中數(shù)據(jù)庫(kù)的定時(shí)備份的相關(guān)資料,需要的朋友可以參考下2023-05-05
linux手動(dòng)、自動(dòng)更改網(wǎng)卡MAC地址的方法
這篇文章主要給大家介紹了關(guān)于linux如何手動(dòng)、自動(dòng)更改網(wǎng)卡MAC地址的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用linux具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2018-06-06
Linux下部署springboot項(xiàng)目的方法步驟
這篇文章主要介紹了Linux下部署springboot項(xiàng)目的方法步驟,由于springboot是內(nèi)嵌了tomcat,所以可以直接將項(xiàng)目打包上傳至服務(wù)器上,具體實(shí)例方法大家參考下本文2018-06-06
centos系統(tǒng)安裝Kubernetes集群步驟
大家好,本篇文章主要講的是centos系統(tǒng)安裝Kubernetes集群步驟,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話(huà)記得收藏一下,方便下次瀏覽2022-01-01
詳解linux ntp服務(wù)器時(shí)間同步設(shè)置
這篇文章主要介紹了linux ntp服務(wù)器時(shí)間同步設(shè)置的相關(guān)資料,需要的朋友可以參考下2017-07-07
Linux中l(wèi)ogrotate日志輪詢(xún)操作總結(jié)
這篇文章主要給大家介紹了在Linux中l(wèi)ogrotate日志輪詢(xún)操作的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起看看吧。2017-06-06
Ubuntu系統(tǒng)網(wǎng)絡(luò)故障排查的方法
最近在使用Ubuntu系統(tǒng)的時(shí)候碰到一個(gè)問(wèn)題,連接無(wú)線(xiàn)網(wǎng)絡(luò)的時(shí)候,發(fā)現(xiàn)右上角網(wǎng)絡(luò)設(shè)置中沒(méi)有 Enable Wi-Fi 這個(gè)選項(xiàng)了,所以通過(guò)一步步排查,終于找了解決辦法,現(xiàn)在分享給大家,有需要的朋友們可以參考借鑒。2016-10-10

