推荐阅读
微服务: springboot 系列教程学习
源码: Javaweb 练手项目源码下载
调优: 十五篇好文回顾
面试笔试: 面试笔试整理系列
一,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 的优势
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
2, 删除 mysql
本人测试过,mysql5.1,mysql5.5 可以平滑转到 mariadb,mysql5.6.X 并没有测试。不放心的可以先用 mysqldump 进行备份一下。不删除 mysql 是装不了 mariadb
- #yum remove mysql mysql - server
3,安装 mariadb
- #yum install MariaDB - server MariaDB - client #yum install MariaDB - Galera - server MariaDB - client galera
- //具有同步多主集群特性
三,启动并测试 mariadb
1, 启动 mariadb
- # / etc / init.d / mysql start
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)
- 作者:海底苍鹰原文:http: //blog.51yip.com/mariadb/1671.html
来源: http://mp.weixin.qq.com/s/OskaYyf_74O1uRfdtfXh9w