MariaDB 10.0.x 版是以 MariaDB 5.5 为基础, 加上移植自 MySQL 5.6 版的功能和自行开发的新功能。以下会介绍在 RHEL 及 CentOS 用 YUM 安装 MariaDB 10.0 的方法。
首先建立 MariaDB 的 YUM Repository, 建立档案 /etc/yum.repos.d/MariaDB.repo, 根据不同的系统加不相关内容:
RHEL / CentOS 7
|
1 2 3 4 5 6 7 |
# MariaDB 10.0 CentOS repository list – created 2014-10-13 13:04 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 |
RHEL / Centos 6 64-Bit
|
1 2 3 4 5 6 7 |
# MariaDB 10.0 CentOS repository list - created 2014-03-12 12:47 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 |
RHEL / CentOS 6 32-Bit
|
1 2 3 4 5 6 7 |
# MariaDB 10.0 CentOS repository list - created 2014-03-12 12:46 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-x86 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 |
建立了 MariaDB 的 YUM Repository 后, 现在可以用 YUM 安装 MariaDB 10.0:
# yum install MariaDB-server MariaDB-client -y
完成安装后, 用以下指令启动 MariaDB 及设定开机自动启动:
# systemctl start mysql
# systemctl enable mysql
# systemctl enable mysql
或
# service mysql start
# chkconfig mysql on
# chkconfig mysql on
MariaDB 跟 MySQL 一样, 默认的 root 密码是空密码, 执行 mysql_secure_installation 修改:
# mysql_secure_installation
跟着步骤回答问题便完成了, 要测试 MariaDB 是否成功安装, 可以用以下指令连接:
# mysql -u root -p
如果输入密码后成功连接, 那就表示安装成功了。