Home > Database > Mysql Tutorial > mysql 向 mariadb 平滑 过渡

mysql 向 mariadb 平滑 过渡

WBOY
Release: 2016-06-07 16:42:00
Original
1174 people have browsed it

一,mariadb与mysql 1,mariadb简介 MariaDB由MySQL的创始人Michael Widenius(英语:Michael Widenius)主导开发,他早前曾以10亿美元的价格,将自己创建的公司MySQL AB卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的所有权也落入Oracle的手中。MariaDB名称

一,mariadb与mysql

1,mariadb简介

MariaDB由MySQL的创始人Michael Widenius(英语:Michael Widenius)主导开发,他早前曾以10亿美元的价格,将自己创建的公司MySQL AB卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的所有权也落入Oracle的手中。MariaDB名称来自Michael Widenius的女儿Maria的名字。

2,mariadb产生的原因

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。在存储引擎方面,使用XtraDB(英语:XtraDB)来代替MySQL的InnoDB。

3,mariadb的优势

可免费商业使用(被oracle收购后,MySQL便有了社区版和企业版之分)
Maria 存储引擎
PBXT 存储引擎
XtraDB 存储引擎
FederatedX 存储引擎
更快的复制查询处理
线程池
更少的警告和bug
运行速度更快
更多的 Extensions
更好的功能测试
数据表消除
慢查询日志的扩展统计
支持对 Unicode 的排序

4,已经开始使用mariadb

google,twitter,facebook这个大公司也已经,或者开始从mysql转向mariadb
redhat,archlinux,opensuse,slackware,fedora新版本已经,或者已宣布将mariadb代替mysql做为默认数据库。

个人一直把google做为技术的风向标,google在oracle收购mysql没多久就转投到mariadb门下了,可见mysql前途暗淡。

二,安装mariadb

1,mariadb源

[root@node1 tank]# cat /etc/yum.repos.d/mariadb.repo    //32位系统
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/5.5/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[root@node1 tank]# cat /etc/yum.repos.d/mariadb.repo   //64位系统
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Copy after login

2,删除mysql

本人测试过,mysql5.1,mysql5.5可以平滑转到mariadb,mysql5.6.X并没有测试。不放心的可以先用mysqldump进行备份一下。不删除mysql是装不了mariadb

# yum remove mysql mysql-server
Copy after login

3,安装mariadb

# yum install MariaDB-server MariaDB-client
# yum install MariaDB-Galera-server MariaDB-client galera //具有同步多主集群特性
Copy after login

三,启动并测试mariadb

1,启动mariadb

# /etc/init.d/mysql start
Copy after login

2,测试mariadb

[root@node1 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 207
Server version: 5.5.40-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                                    | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                                      | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                                         | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears)             | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                                      | NO           | NO   | NO         |
| FEDERATED          | YES     | FederatedX pluggable storage engine                                        | YES          | NO   | YES        |
| ARCHIVE            | YES     | Archive storage engine                                                     | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                         | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                  | NO           | NO   | NO         |
| Aria               | YES     | Crash-safe tables with MyISAM heritage                                     | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
10 rows in set (0.03 sec)
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template