CentOS7預設庫變成了MariaDB,想繼續用MySQL可以用用Oracle提供的yum repoitory來安裝MySQL Community Server……
安裝repository先~
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
安裝MySQL server~
yum install mysql-community-server
設定開機啟動MySQL
/usr/bin/systemctl enable mysqld
啟動MySQL
/usr/bin/systemctl start mysqld
設定 root 密碼
[root@localhost test]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): (輸入密碼)
安裝MySQL的過程中看到You need to be root to perform this command.
表示權限不足來的,記得嚕一下嘿~~~
著樣嚕(指
[test@localhost ~]$ sudo su root
[sudo] password for test:
[root@localhost test]#