CentOS 7 安装 MariaDB 10.1
CentOS 7 安裝 MariaDB 10.1
使用默認(rèn)的?yum install mariadb-server時,默認(rèn)安裝的是和Mysql相兼容的5.5版本。想安裝Mariadb 10.1或以上版本,必須先指定yum源。
使用源配置向?qū)?/p>
https://downloads.mariadb.org/mariadb/repositories
可以選擇合適的操作系統(tǒng)和想要安裝的MariaDB版本,然后自動生成源配置。
我使用的是:
# MariaDB 10.1 CentOS repository list - created 2016-05-12 09:28 UTC# http://mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.1/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1配置yum源
/etc/yum.repos.d/
touch MariaDB.repo
vim MariaDB.repo
將上面的內(nèi)容復(fù)制進去,保存退出。
安裝MariaDB 10.1
yum install MariaDB-server MariaDB-client
如果出現(xiàn)了?MariaDB can’t be installed because of conflict with mariadb-libs-xxxx,則需要先卸載當(dāng)前安裝的版本:
yum remove mariadb-libs*
安裝完成后,會提示你為root設(shè)置密碼,此時需要先運行Mariadb。
運行 MariaDB
service mysql start
輸出:
Starting mysql (via systemctl): [ OK ]
配置 MariaDB
mysql_secure_installation
如果出現(xiàn)?error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")',則說明mariadb沒有啟動,需要先運行Mariadb,參考第5步。
Enter current password for root (enter for none): 輸入當(dāng)前的root密碼(默認(rèn)空),直接回車Set root password? [Y/n] 設(shè)置新密碼,yRemove anonymous users? [Y/n] 移除匿名用戶,yDisallow root login remotely? [Y/n] 禁止root用戶遠(yuǎn)程登錄,yRemove test database and access to it? [Y/n] 移除測試數(shù)據(jù)庫,yReload privilege tables now? [Y/n] y 配置
Mysql在Linux上默認(rèn)是表名大小寫敏感的,需要手動配置才能使之忽略大小寫:
vim vim /etc/my.cnf
在[mysqld]下,修改(沒有則添加):
lower_case_table_names=1
然后重啟mysql服務(wù)
service mysql restart
總結(jié)
以上是生活随笔為你收集整理的CentOS 7 安装 MariaDB 10.1的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 京东/淘宝的手机销售榜(前4名 -- 手
- 下一篇: 2015Astar百度之星初赛 1001