mariadb簡(jiǎn)介
mariadb數(shù)據(jù)庫(kù)管理系統(tǒng)是mysql的一個(gè)分支,主要由開源社區(qū)在維護(hù),采用gpl授權(quán)許可 mariadb的目的是完全兼容mysql,包括api和命令行,使之能輕松成為mysql的代替品。在存儲(chǔ)引擎方面,使用xtradb(英語:xtradb)來代替mysql的innodb。 mariadb由mysql的創(chuàng)始人michael widenius(英語:michael widenius)主導(dǎo)開發(fā),他早前曾以10億美元的價(jià)格,將自己創(chuàng)建的公司mysql ab賣給了sun,此后,隨著sun被甲骨文收購(gòu),mysql的所有權(quán)也落入oracle的手中。mariadb名稱來自michael widenius的女兒maria的名字。
MariaDB 官網(wǎng):https://mariadb.org/
MariaDB 下載:https://downloads.mariadb.org/
MariaDB Github地址:https://github.com/MariaDB/server
安裝mariadb 5.5
安裝mariadb 5.5是centos 7的默認(rèn)版本,配置數(shù)據(jù)庫(kù)服務(wù)器
1
2
3
4
5
6
7
8
|
[root@linuxprobe~] # yum -y install mariadb-server [root@linuxprobe~] # vi /etc/my.cnf # add follows within [mysqld] section [mysqld] character- set -server=utf8 [root@linuxprobe~] # systemctl start mariadb [root@linuxprobe~] # systemctl enable mariadb ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' |
初始化mariadb
連接mariadb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
[root@linuxprobe ~] # mysql -u root -p enter password: welcome to the mariadb monitor. commands end with ; or \g. your mariadb connection id is 1023 server version: 5.5.50-mariadb mariadb server copyright (c) 2000, 2016, oracle, mariadb corporation ab and others. type 'help;' or '\h' for help. type '\c' to clear the current input statement. mariadb [(none)]> select user,host,password from mysql.user; +-----------+-----------+-------------------------------------------+ | user | host | password | +-----------+-----------+-------------------------------------------+ | root | localhost | *f1dae8bcdfca7a57f246e0f834ac35830a3d640e | | root | 127.0.0.1 | *f1dae8bcdfca7a57f246e0f834ac35830a3d640e | | root | ::1 | *f1dae8bcdfca7a57f246e0f834ac35830a3d640e | +-----------+-----------+-------------------------------------------+ 5 rows in set (0.00 sec) mariadb [(none)]> show databases; +--------------------+ | database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 5 rows in set (0.05 sec) mariadb [(none)]> exit ; bye |
防火墻開啟3306端口
1
2
3
4
5
|
# 客戶端設(shè)置 [root@vdevops ~] # firewall-cmd --add-service=mysql --permanent success [root@vdevops ~] # firewall-cmd --reload success |
安裝phpmyadmin
前提安裝web服務(wù)器和php,參考下面:
http://www.zmynmublwnt.cn/article/207898.html
http://www.zmynmublwnt.cn/article/207912.html
安裝phpmyadmin
1
2
3
4
5
6
7
8
|
# install from epel [root@linuxprobe~] # yum --enablerepo=epel -y install phpmyadmin php-mysql php-mcrypt [root@linuxprobe~] # vi /etc/httpd/conf.d/phpmyadmin.conf # line 17: ip address you permit to access require ip 127.0.0.1 10.1.1.0 /24 # line 34: ip address you permit to access require ip 127.0.0.1 10.1.1.o /24 [root@linuxprobe ~] # systemctl restart httpd |
使用web瀏覽器從客戶端訪問“http://(您的主機(jī)名或ip地址)/ phpmyadmin /',然后在mariadb的用戶在以下屏幕上登錄。此示例使用root用戶繼續(xù)。
登錄之后,您可以在這里操作mariadb
mariadb 主從復(fù)制
mariadb 主從復(fù)制和mysql主從復(fù)制相同,請(qǐng)移步到:http://www.zmynmublwnt.cn/article/80637.html
安裝 mariadb 10.1
配置 centos sclo源倉(cāng)庫(kù)
來自centos-sclo-rh的軟件包安裝在/ opt目錄下。 要使用它,加載環(huán)境變量如下。
1
2
3
4
5
|
[root@linuxprobe ~] # scl enable rh-mariadb101 bash [root@linuxprobe ~] # mysql -v mysql ver 15.1 distrib 10.1.14-mariadb, for linux (x86_64) using editline wrapper [root@linuxprobe ~] # which mysql /opt/rh/rh-mariadb101/root/usr/bin/mysql |
如果您希望在登錄時(shí)自動(dòng)啟用mariadb 10.1,請(qǐng)如下配置
1
2
3
4
5
|
[root@linuxprobe ~] # vi /etc/profile.d/rh-mariadb101.sh # create new #!/bin/bash source /opt/rh/rh-mariadb101/enable export x_scls= "`scl enable rh-mariadb101 'echo $x_scls'`" |
啟用mariadb 10.1并配置初始設(shè)置
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。
原文鏈接:http://blog.csdn.net/wh211212/article/details/53129488