1. 在 /etc/yum.repos.d/
下建立
MariaDB.repo,輸入內容
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.1.10/centos6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
如需其他版本, 到 http://yum.mariadb.org/ 查看
2. 執行安裝
yum -y install MariaDB-client MariaDB-server
3. 啓動 mysql 服務
service mysql start
4.
修改root密碼
mysqladmin -u root password '111111'
5. 配置 MariaDB
$ sudo /usr/bin/mysql_secure_installation
[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
All done!
6. 登錄
mysql -u root -p