centos yum 安裝 mariadb

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



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章