CentOS7安裝與設(shè)置MySQL
發(fā)表時(shí)間:2023-07-27 來(lái)源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]1. 下載MySQL Yum Repository2. 本地安裝MySQL Yum Repository
sudo yum localinstall platform-and-version-spe...
?
1. 下載MySQL Yum Repository
?
2. 本地安裝MySQL Yum Repository
sudo yum localinstall platform-and-version-specific-package-name.rpm
?
3. 安裝MySQL
sudo yum -y install mysql-community-server
?
4. 查看root初始密碼
sudo grep 'temporary password' /var/log/mysqld.log
?
5. 執(zhí)行安全性設(shè)置
mysql_secure_installation
?
6.設(shè)置字符集
vi /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
character_set_server=utf8
?
7. 設(shè)置開(kāi)機(jī)啟動(dòng)
chkconfig --levels 235 mysqld on
?
8. 關(guān)閉CentOS防火墻
firewall-cmd --permanent --zone=public --add-port=3306/tcp
firewall-cmd --permanent --zone=public --add-port=3306/udp
firewall-cmd --reload
?
9. 創(chuàng)建遠(yuǎn)程訪問(wèn)用戶
CREATE USER 'bounter'@'%' IDENTIFIED BY '111111@Bounter';
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'bounter'@'%';
flush privileges;
?
10. 啟動(dòng)和關(guān)閉MySQL服務(wù)
sudo service mysqld start
sudo service mysqld stop
以上就是CentOS7安裝和配置MySQL的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!
學(xué)習(xí)教程快速掌握從入門(mén)到精通的SQL知識(shí)。