1. 程式人生 > >centos7 mysql數據庫安裝指南

centos7 mysql數據庫安裝指南

sta -i arch option href centos7 stat system .rpm

1.安裝mysql源: wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm 2.安裝mysql服務 yum -y install mysql-server 3.設置開啟啟動,啟動mysql服務: systemctl enable mysqld.service systemctl start mysqld.service 查看mysql運行狀態:systemctl status mysqld.service mysql_secure_installation 初始化數據庫 4.設置root密碼,配置遠程連接訪問權限: a.進入mysql: mysql -uroot b.設置root密碼:set password = password(‘XXX‘) c.設置遠程連接訪問: grant all privileges on *.* to ‘root‘@‘localhost‘ identified by ‘xxx‘ with grant option; grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘xxx‘ with grant option; grant all privileges on *.* to ‘root‘@‘127.0.0.1‘ identified by ‘xxx‘ with grant option; flush privileges; exit; 配置成功。

centos7 mysql數據庫安裝指南