2014年1月8日 星期三

[研究] MariaDB 5.5.34 資料庫安裝(yum) (CentOS 6.5 x64)

[研究] MariaDB 5.5.34 資料庫安裝(yum) (CentOS 6.5 x64)

2014-01-08

瑪利亞資料庫 (Maria) 是 MySQL 創辦人離開 Sun 後又開的公司所開發的資料庫系統,很多操作和觀念和原來的 MySQL 相同。

官方網站 : 瑪利亞資料庫 (Maria)
http://askmonty.org/wiki/index.php/MariaDB
下載網頁
http://askmonty.org/wiki/MariaDB:Download
安裝說明
https://mariadb.com/kb/en/installing-mariadb-with-yum/
http://kb.askmonty.org/v/getting-started
https://mariadb.com/kb/en/getting-started-with-mariadb-galera-cluster/

安裝

為了省麻煩,防火牆先關閉,請把 SELinux 也關閉

要立刻關閉 SELinux (但 reboot 後仍會開啟)可執行 /usr/sbin/setenforce 0

要永久關閉,請修改 /etc/selinux/config
把 SELINUX=enforcing 改為 SELINUX=disabled
此修改不會立刻生效,要 reboot 才有效

CentOS 用 yum 安裝的 MySQL 是不能架設 Cluster 的,必須移除,
然後去 MySQL 官方網站註冊和下載 MySQL Cluster 使用的套件
(rpm 安裝和 tar.gz 安裝的很多路徑不同,如果使用非 rpm 請自己另外研究)

/usr/sbin/setenforce  0 
sed -i -e "s@SELINUX=enforcing@#SELINUX=enforcing@" /etc/selinux/config
sed -i -e "s@SELINUX=permissive@#SELINUX=permissive@" /etc/selinux/config
sed -i -e "/SELINUX=/aSELINUX=disabled" /etc/selinux/config
service iptables stop
yum -y remove mysql*


修改 Yum 安裝設定
vi /etc/yum.repos.d/MariaDB.repo


內容

# MariaDB 5.5 CentOS repository list - created 2013-02-08 00:52 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

看看提供了些甚麼

[root@localhost ~]# yum list | grep MariaDB
MariaDB-Galera-server.x86_64              5.5.34-1                       mariadb
MariaDB-client.x86_64                     5.5.34-1                       mariadb
MariaDB-common.x86_64                     5.5.34-1                       mariadb
MariaDB-compat.x86_64                     5.5.34-1                       mariadb
MariaDB-devel.x86_64                      5.5.34-1                       mariadb
MariaDB-server.x86_64                     5.5.34-1                       mariadb
MariaDB-shared.x86_64                     5.5.34-1                       mariadb
MariaDB-test.x86_64                       5.5.34-1                       mariadb
[root@localhost ~]#

安裝 MariaDB Server

yum -y install MariaDB-server MariaDB-client


啟動

[root@localhost ~]# service mysql start
Starting MySQL... SUCCESS!

測試

[root@localhost ~]# mysql --version
mysql  Ver 15.1 Distrib 5.5.34-MariaDB, for Linux (x86_64) using readline 5.1
[root@localhost ~]#


[root@localhost ~]# ps aux | grep mysql
root      2826  0.0  0.1  11436  1516 pts/1    S    22:04   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid
mysql     2919  1.6 10.0 717604 101804 pts/1   Sl   22:04   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/lib/mysql/localhost.localdomain.pid
root      2943  0.0  0.0 103244   864 pts/1    S+   22:04   0:00 grep mysql
[root@localhost ~]#

[root@localhost ~]# netstat  -tan  |  grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN

變更密碼

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

(完)

相關

[研究] MariaDB 5.5.34 安裝(yum) (CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/01/mariadb-5534-yum-centos-65-x64.html

[研究] MariaDB 5.5 安裝(yum)(CentOS 6.3 x64)
http://shaurong.blogspot.tw/2013/02/mariadb-55-yum-centos-63-x64.html
http://forum.icst.org.tw/phpbb/viewtopic.php?t=79306

[研究] MariaDB 5.1.42 安裝 (tar.gz)(CentOS 5.4 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=17988

[研究] MariaDB 5.2.4 安裝 (tar.gz)(CentOS 5.5 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=19434

MySQL 共同創辦人將離開昇陽自創公司(2009-02-06)
http://forum.icst.org.tw/phpbb/viewtopic.php?f=21&t=16331

沒有留言:

張貼留言