系統(tǒng)環(huán)境:centos7.4
一,查看是否安裝有數(shù)據(jù)庫:
yum list installed | grep mysqld/mariadb
二,安裝centos7系統(tǒng)帶有mysql5.6安裝包的yum源RPM資源包:
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum clean all
yum repolist
三,安裝msyql5.6:
yum -y install mysql-community-server
四,啟動服務(wù):
systemctl start mysqld
systemctl enable mysqld
五,重置密碼:是具體情況而定(可以省略,無密碼登陸)
#mysql_secure_installation
Set root password? [Y/n] y [設(shè)置root用戶密碼]
Remove anonymous users? [Y/n] y [刪除匿名用戶]
Disallow root login remotely? [Y/n] n [禁止root遠(yuǎn)程登錄]
Remove test database and access to it? [Y/n] y [刪除test數(shù)據(jù)庫]
Reload privilege tables now? [Y/n] y [刷新權(quán)限]
六,查看mysql版本:
mysql -V
mysql Ver 14.14 Distrib 5.6.39, for Linux (x86_64) using EditLine wrapper
七,驗證:(無密碼)
mysql -uroot -p 密碼
八、設(shè)置密碼和遠(yuǎn)程權(quán)限
數(shù)據(jù)庫密碼設(shè)置:#set password for 'root'@'localhost'=password('userpasswd');
九、配置防火墻
firewall-cmd --zone=public --add-port=3306/tcp --permanent
您可能感興趣的文章:- Centos7 下mysql重新啟動MariaDB篇
- Centos7.3下mysql5.7.18安裝并修改初始密碼的方法
- Linux centos7環(huán)境下MySQL安裝教程
- Centos7下無法遠(yuǎn)程連接mysql數(shù)據(jù)庫的原因與解決
- 詳解Centos7 修改mysql指定用戶的密碼
- 64位CentOs7源碼安裝mysql-5.6.35過程分享
- CentOs7.x安裝Mysql的詳細(xì)教程
- mysql 5.7.17 安裝配置方法圖文教程(CentOS7)
- 阿里云CentOS7搭建Apache+PHP+MySQL環(huán)境
- Centos7使用yum安裝Mysql5.7.19的詳細(xì)步驟