MariaDB

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(CentOS)
(安全加密)
(未显示1个用户的43个中间版本)
第1行: 第1行:
 
{{SeeWikipedia}}
 
{{SeeWikipedia}}
[[Image:Mariadb-90x90.gif|right]]
+
[[Image:Mariadb-foundation.png|right]]
  
Mariadb, a [[MySQL]] branch with the Maria storage engine
+
MariaDB
  
 
==简介==
 
==简介==
第16行: 第16行:
  
 
==版本==
 
==版本==
===10.1===
+
[https://mariadb.com/kb/en/mariadb-releases/ MariaDB Releases]
 +
 
 +
{| class="wikitable"
 +
|-
 +
! MariaDB tree
 +
! MySQL tree
 +
|-
 +
| 5.1
 +
| 5.1
 +
|-
 +
| 5.2
 +
| 5.1
 +
|-
 +
| 5.3
 +
| 5.1
 +
|-
 +
| 5.5
 +
| 5.5
 +
|-
 +
| 10.0
 +
| 5.5, partly 5.6
 +
|}
 +
 
 +
[https://mariadb.org/about MariaDB 每年会发布一个 GA 稳定版] MariaDB 基金会也保证每个版本都会至少维护5年,可以理解为 Long Term Support (LTS)。
 +
 
 +
[[文件:mariadb-general-release-maintenance-periods.png]]
 +
 
 +
===10.x===
 +
MariaDB 10.x 分支:
 +
*[https://github.com/MariaDB/server/tree/10.6 10.6]
 +
*[https://github.com/MariaDB/server/tree/10.5 10.5]
 +
*[https://github.com/MariaDB/server/tree/10.4 10.4]
 +
*[https://github.com/MariaDB/server/tree/10.3 10.3]
 +
*[https://github.com/MariaDB/server/tree/10.2 10.2]
 +
*[https://github.com/MariaDB/server/tree/10.1 10.1]
 
*[https://blog.mariadb.org/10-1-mio-qps/ MariaDB 10.1 can do 1 million queries per second]
 
*[https://blog.mariadb.org/10-1-mio-qps/ MariaDB 10.1 can do 1 million queries per second]
  
第49行: 第83行:
 
* Table elimination: Optimizer enhancement.
 
* Table elimination: Optimizer enhancement.
 
* More information in the logs for better troubleshooting.
 
* More information in the logs for better troubleshooting.
* Speed optimizations  
+
* Speed optimizations
  
 
==指南==
 
==指南==
第76行: 第110行:
  
 
===Debian===
 
===Debian===
  apt-get install python-software-properties
+
  $ sudo apt update
  apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
+
  $ sudo apt install mariadb-server
  add-apt-repository 'deb http://mirrors.hustunique.com/mariadb/repo/10.1/debian wheezy main'
+
  $ sudo mysql_secure_installation
  apt-get update
+
$ sudo mysql
  apt-get install mariadb-server mariadb-client
+
MariaDB [(none)]> GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql -V
+
  MariaDB [(none)]> FLUSH PRIVILEGES;
 +
  MariaDB [(none)]> exit
 +
$ sudo systemctl status mariadb
 +
$ sudo mysqladmin version
 +
$ mysqladmin -u admin -p version
 +
 
 
选择其它仓库:[https://downloads.mariadb.org/mariadb/repositories Setting up MariaDB Repositories]
 
选择其它仓库:[https://downloads.mariadb.org/mariadb/repositories Setting up MariaDB Repositories]
  
第90行: 第129行:
  
 
$ sudo mysql_secure_installation 设置 root 密码等
 
$ sudo mysql_secure_installation 设置 root 密码等
 +
 +
===[[Container]]===
 +
[https://mariadb.com/kb/en/creating-a-custom-docker-image/ Creating a Custom Docker Image]
 +
*[https://github.com/docker-library/mariadb Docker Official Image]
 +
*[https://github.com/docker-library/mysql MySQL Image]
  
 
===编译===
 
===编译===
第105行: 第149行:
 
==存储引擎==
 
==存储引擎==
 
[https://mariadb.com/kb/en/storage-engines/ MariaDB Storage Engines]
 
[https://mariadb.com/kb/en/storage-engines/ MariaDB Storage Engines]
 +
*[[XtraDB]]
 +
*[[TokuDB]]
 
*[[InnoDB]]
 
*[[InnoDB]]
 
*[[Sphinx]]SE
 
*[[Sphinx]]SE
 +
===CONNECT===
 +
[https://mariadb.com/kb/en/connect/ CONNECT storage engine]
 +
sudo apt-get install mariadb-plugin-connect
 +
or sudo yum install MariaDB-connect-engine
 +
MariaDB [mysql]> show plugins;
  
==解决方案==
+
===Archive===
[[文件:MariaDB-Galera-Cluster.png|right]]
+
[https://mariadb.com/kb/en/archive/ ARCHIVE storage engine]
*[[Vitess]] MySQL Cluster
+
MariaDB [mysql]> INSTALL PLUGIN Archive SONAME 'ha_archive.so';
*[https://mariadb.com/products/solutions/oltp-database-tx MariaDB TX] for [[OLTP]]
+
 
*[https://mariadb.com/products/solutions/olap-database-ax MariaDB AX] for [[OLAP]]
+
===FederatedX===
*[https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster/ MariaDB Galera Cluster]
+
[https://mariadb.com/kb/en/federatedx-storage-engine/ FederatedX Storage Engine]
*[[Galera Cluster]] [https://github.com/codership/galera Galera @ GitHub]
+
MariaDB [mysql]> INSTALL SONAME 'ha_federatedx';
*[https://www.howtoforge.com/tutorial/how-to-setup-haproxy-as-load-balancer-for-mariadb-on-centos-7/ How to setup HAProxy as Load Balancer for MariaDB on CentOS 7]
+
 
 +
===MyRocks===
 +
[https://mariadb.com/kb/en/myrocks/ MyRocks] 是一个 MariaDB 存储引擎,它将 [[RocksDB]] 数据库添加到 MariaDB 中。RocksDB 是一个LSM数据库,具有很好的压缩比,针对闪存进行了优化。
 +
sudo apt-get install mariadb-plugin-rocksdb
 +
or sudo yum install MariaDB-rocksdb-engine
 +
MariaDB [mysql]> INSTALL SONAME 'ha_rocksdb';
 +
SHOW PLUGINS;
 +
SHOW VARIABLES LIKE 'rocksdb_supported_compression_types';
 +
 
 +
===Spider===
 +
[https://mariadb.com/kb/en/spider/ Spider storage engine]
 +
 
 +
[https://mariadb.com/docs/storage-engines/spider/spider-use-cases/#spider-use-cases Comparing Spider to Features in Other Databases]
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Database
 +
! Feature
 +
|-
 +
| [[Oracle]]
 +
| Database Links
 +
|-
 +
| [[Microsoft SQL Server]]
 +
| Linked Servers
 +
|-
 +
| [[SAP]]/[[Sybase]]
 +
| Remote Servers and Proxy Tables
 +
|-
 +
| [[PostgreSQL]]
 +
| Foreign Data Wrappers
 +
|-
 +
| [[MySQL]]
 +
| FEDERATED Storage Engine
 +
|}
  
 
==Cassandra==
 
==Cassandra==
 +
Cassandra Storage Engine is no longer actively being developed and has been removed in MariaDB 10.6
 
*[https://mariadb.com/kb/en/library/cassandra/ MariaDB Cassandra Storage Engine]
 
*[https://mariadb.com/kb/en/library/cassandra/ MariaDB Cassandra Storage Engine]
 
*[http://www.infoq.com/cn/news/2012/11/Cassandra-SE MariaDB的Cassandra存储引擎],允许MariaDB通过标准SQL语法使用[[Apache Cassandra|Cassandra]]集群。
 
*[http://www.infoq.com/cn/news/2012/11/Cassandra-SE MariaDB的Cassandra存储引擎],允许MariaDB通过标准SQL语法使用[[Apache Cassandra|Cassandra]]集群。
 +
 +
==ColumnStore==
 +
[https://mariadb.com/kb/en/mariadb-columnstore/ MariaDB ColumnStore]
 +
 +
此列式存储是基于 [[InfiniDB]] 4.6.7 并移植到 MariaDB 的
  
 
==Amazon==
 
==Amazon==
 
*[https://aws.amazon.com/cn/rds/mariadb/ Amazon RDS for MariaDB]
 
*[https://aws.amazon.com/cn/rds/mariadb/ Amazon RDS for MariaDB]
 
==管理==
 
*[[Sequel Pro]]
 
*[[HeidiSQL]]
 
*[[DBeaver]]
 
  
 
==[[.NET]]==
 
==[[.NET]]==
第135行: 第220行:
 
==MaxScale==
 
==MaxScale==
 
*[https://github.com/mariadb-corporation/MaxScale MaxScale @ GitHub]
 
*[https://github.com/mariadb-corporation/MaxScale MaxScale @ GitHub]
 +
 +
==连接器==
 +
*[https://github.com/mariadb-corporation/mariadb-connector-r2dbc MariaDB R2DBC connector] [https://github.com/r2dbc R2DBC – Reactive Relational Database Connectivity]
 +
 +
==管理==
 +
[https://mariadb.com/kb/en/graphical-and-enhanced-clients/ Graphical and Enhanced Clients]
 +
*[[phpMyAdmin]]
 +
*[[Sequel Pro]]
 +
*[[HeidiSQL]]
 +
*[[DBeaver]]
 +
 +
==解决方案==
 +
[[文件:MariaDB-Galera-Cluster.png|right]]
 +
[https://mariadb.com/kb/en/replication-cluster-multi-master/ High Availability & Performance Tuning] replication, clustering, multi-master and performance tuning solutions. OLTP(InnoDB),OLAP(ColumnStore),HTAP(MaxScale)解决方案:
 +
*[https://mariadb.com/kb/en/mariadb-platform-x3/ MariaDB Platform X3]
 +
*[[Vitess]] MySQL Cluster
 +
*[https://mariadb.com/products/solutions/oltp-database-tx MariaDB TX] for [[OLTP]]
 +
*[https://mariadb.com/products/solutions/olap-database-ax MariaDB AX] for [[OLAP]]
 +
*[https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster/ MariaDB Galera Cluster]
 +
*[https://www.howtoforge.com/tutorial/how-to-setup-haproxy-as-load-balancer-for-mariadb-on-centos-7/ How to setup HAProxy as Load Balancer for MariaDB on CentOS 7]
 +
 +
===[https://mariadb.com/products/skysql/ SkySQL]===
 +
*[https://mariadb.com/kb/en/standard-replication/ MariaDB Replication]
 +
*[[Galera Cluster]] [https://github.com/codership/galera Galera @ GitHub]
 +
*[https://mariadb.com/resources/blog/uses-for-mariadb-and-the-spider-storage-engine/ Uses for MariaDB and the Spider Storage Engine]
 +
*[https://mariadb.com/resources/blog/how-mariadb-achieves-global-scale-with-xpand/ How MariaDB Achieves Global Scale with Xpand]
 +
 +
[https://mariadb.com/docs/storage-engines/ MariaDB Enterprise Server Storage Engines]
 +
 +
{| class="wikitable"
 +
|-
 +
! Engine
 +
! Target
 +
! Optimization
 +
! Availability
 +
|-
 +
| [https://mariadb.com/kb/en/aria/ Aria]
 +
| Read-Heavy
 +
| Reads
 +
| ES10.2+
 +
|-
 +
| [https://mariadb.com/kb/en/mariadb-columnstore/ ColumnStore]
 +
| Analytics, HTAP
 +
| Big Data, Analytical
 +
| ES10.4+
 +
|-
 +
| [https://mariadb.com/kb/en/innodb/ InnoDB]
 +
| General Purpose
 +
| Mixed Read/Write
 +
| ES10.2+
 +
|-
 +
| [https://mariadb.com/kb/en/myisam/ MyISAM]
 +
| Reads
 +
| Reads
 +
| ES10.2+
 +
|-
 +
| [https://mariadb.com/kb/en/myrocks/ MyRocks]
 +
| Write-Heavy
 +
| I/O Reduction, SSD
 +
| ES10.3+
 +
|-
 +
| [https://mariadb.com/kb/en/s3-storage-engine/ S3]
 +
| Cloud
 +
| Read-Only
 +
| ES10.3+
 +
|-
 +
| [https://mariadb.com/docs/storage-engines/spider Spider]
 +
| Federation
 +
| Sharding, Interlink
 +
| ES10.3+
 +
|-
 +
| [https://mariadb.com/docs/storage-engines/xpand Xpand]
 +
| Distributed SQL
 +
| Scale-Out, Fault Tolerance
 +
| ES10.5+
 +
|}
 +
 +
===GIS===
 +
[https://mariadb.com/kb/en/geographic-geometric-features/ Geographic & Geometric Features]
 +
*[https://programm.froscon.de/2016/system/event_attachments/attachments/000/000/388/original/MariaDB_MySQL_GIS_Features.pdf GIS features in MariaDB and MySQL]
 +
*[https://develdocs.phpmyadmin.net/phpmyadmin/PhpMyAdmin/Gis.html PhpMyAdmin Gis]
 +
 +
===安全加密===
 +
*[https://mariadb.com/kb/en/data-in-transit-encryption/ Data-in-Transit Encryption]
 +
*[https://mariadb.com/docs/security/encryption/at-rest Data-at-Rest Encryption] HashiCorp [[Vault]] Encryption Plugin
 +
*[https://mariadb.com/docs/security/ MariaDB Platform Security Guide]
 +
 +
===后端存储===
 +
*[https://github.com/letsencrypt/openzfs-nvme-databases ZFS datastore for MariaDB]
  
 
==书籍==
 
==书籍==
第140行: 第314行:
  
 
==用户==
 
==用户==
*[http://tdsql.org/ TDSQL]腾讯金融级分布式数据库
+
*[https://mariadb.org/thanks-tencent/ Tencent’s DB Kernel Team] 微信 [https://github.com/Tencent/phxsql PhxSQL] 基于 [[Percona Server|Percona]] 构建
 
*[http://galeracluster.com/2017/06/china-mobile-intel-deploy-galera-for-1000-node-openstack-cloud/ China Mobile & Intel Deploy Galera for 1000-Node OpenStack Cloud] [http://galeracluster.com/2017/04/39-of-openstack-users-run-galera-cluster-in-production-for-openstack-components-according-to-recent-survey/ 39% of OpenStack users run Galera Cluster in production for OpenStack components according to recent survey]
 
*[http://galeracluster.com/2017/06/china-mobile-intel-deploy-galera-for-1000-node-openstack-cloud/ China Mobile & Intel Deploy Galera for 1000-Node OpenStack Cloud] [http://galeracluster.com/2017/04/39-of-openstack-users-run-galera-cluster-in-production-for-openstack-components-according-to-recent-survey/ 39% of OpenStack users run Galera Cluster in production for OpenStack components according to recent survey]
  
 
==图集==
 
==图集==
 
<gallery>
 
<gallery>
 +
image:MariaDB-Architecture.png|架构
 
image:mariadb-foss-success.png|MariaDB Foundation
 
image:mariadb-foss-success.png|MariaDB Foundation
 +
image:mariadb-platform-x3-routing-streaming.png|MariaDB Platform X3
 +
image:mariadb-platform-x3-scaleout.png|MariaDB Platform X3
 +
image:mariadb-platform-x3-htap-routing.png|MariaDB Platform X3
 
image:MariaDB-TX-for-OLTP.png|MariaDB TX for OLTP
 
image:MariaDB-TX-for-OLTP.png|MariaDB TX for OLTP
 
image:MariaDB-AX-for-OLAP.png|MariaDB AX for OLAP
 
image:MariaDB-AX-for-OLAP.png|MariaDB AX for OLAP
 
image:MariaDB-Galera-Cluster-on-OpenStack-April-2017.png|OpenStack
 
image:MariaDB-Galera-Cluster-on-OpenStack-April-2017.png|OpenStack
 
image:mariadb-cassandra-storage-engine.png|Cassandra存储引擎
 
image:mariadb-cassandra-storage-engine.png|Cassandra存储引擎
 +
image:mariadb-compatibility-mysql.png|MySQL兼容性
 +
image:MariaDB-Galera-Cluster-Replication.png|Galera复制
 +
image:MariaDB-ColumnStore-Storage-Architecture.jpeg|列式存储架构
 +
image:mariadb-plugin.png|Plugins
 
</gallery>
 
</gallery>
  
第155行: 第337行:
 
*[https://mariadb.org/ MariaDB官网]
 
*[https://mariadb.org/ MariaDB官网]
 
*[https://mariadb.com/ MariaDB商业]
 
*[https://mariadb.com/ MariaDB商业]
 +
*[https://downloads.mariadb.org/ Downloads Source, Binaries, and Packages]
 
*[https://github.com/MariaDB/server MariaDB @ GitHub]
 
*[https://github.com/MariaDB/server MariaDB @ GitHub]
 
*[https://github.com/mariadb-corporation/ MariaDB Corporation @ GitHub]
 
*[https://github.com/mariadb-corporation/ MariaDB Corporation @ GitHub]
第168行: 第351行:
 
[[category:database]]
 
[[category:database]]
 
[[category:c++]]
 
[[category:c++]]
[[category:huihoo]]
+
[[category:Huihoo Foundation]]

2021年2月22日 (一) 12:21的版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 MariaDB Thanks, Wikipedia.
Mariadb-foundation.png

MariaDB

目录

简介

MariaDB is a community developed branch of MySQL. It's a branch of MySQL (ie, we are keeping our code in sync with MySQL) and contains in addition the Maria storage engine, updated version of other storage engines and extensions.

版本策略:目前所有MariaDB发行版都基于 MySQL 5.1. 当 MySQL 5.5 或 MySQL 5.6 变成 RC , 将切换到 MariaDB beta 版并基于RC版本上.

Mariadb-mysql.jpg

新闻

自http://blog.mariadb.org/feed/加载RSS失败或RSS源被墙

版本

MariaDB Releases

MariaDB tree MySQL tree
5.1 5.1
5.2 5.1
5.3 5.1
5.5 5.5
10.0 5.5, partly 5.6

MariaDB 每年会发布一个 GA 稳定版 MariaDB 基金会也保证每个版本都会至少维护5年,可以理解为 Long Term Support (LTS)。

Mariadb-general-release-maintenance-periods.png

10.x

MariaDB 10.x 分支:

10.0

5.5

MariaDB 5.5.30 包含 MariaDB 5.3.12 和 MySQL 5.5.30

5.4

5.3

MariaDB 5.3 将基于 MySQL 5.1 或 MySQL 5.6

5.2

MariaDB 5.2 基于 MySQL 5.1

主要的新功能有:

  • Storage-engine-specific CREATE TABLE
  • Pluggable Authentication
  • Segmented Key Cache; Speeds up MyISAM tables a LOT!
  • Extended User Statistics
  • Virtual Columns
  • New storage engines: OQGRAPH and Sphinx.
  • Speed optimizations

5.1

MariaDB 5.1 基于 MySQL 5.1

主要的新功能有:

  • XtraDB a drop-in replacement for InnoDB based on the InnoDB_plugin. This is enabled by default and gives you the speed comparable to MySQL 5.5 today.
  • New storage engines: PBXT, FederatedX (drop-in replacement for Federated) and Aria.
  • Pool of Threads: Allows you to have 100,000+ connections.
  • Table elimination: Optimizer enhancement.
  • More information in the logs for better troubleshooting.
  • Speed optimizations

指南

OS X

brew info mariadb
brew install mariadb // 通过 Homebrew 安装, brew services start mariadb 和 brew services stop mariadb
unset TMPDIR
cd /usr/local/Cellar/mariadb/10.0.14_1/
mysql_install_db
mysql.server start
mysql_secure_installation
mysql -u root -p
MariaDB [(none)]> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 10.0.14-MariaDB |
+-----------------+
1 row in set (0.00 sec)

升级

brew update
brew upgrade mariadb

Debian

$ sudo apt update
$ sudo apt install mariadb-server
$ sudo mysql_secure_installation
$ sudo mysql
MariaDB [(none)]> GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit
$ sudo systemctl status mariadb
$ sudo mysqladmin version
$ mysqladmin -u admin -p version

选择其它仓库:Setting up MariaDB Repositories

CentOS

How To Install MariaDB on CentOS 8

$ sudo yum install libmariadb-dev 也安装上开发工具包

$ sudo mysql_secure_installation 设置 root 密码等

Container

Creating a Custom Docker Image

编译

cd $maria-source-dir 
BUILD/autorun.sh
./configure
make
sudo make install
sudo chown -R mysql /usr/local/mysql/
sudo scripts/mysql_install_db --user=mysql
sudo /usr/local/mysql/bin/mysqld_safe --port=3307 --user=mysql &
./bin/mysqladmin -uroot password 'password'

存储引擎

MariaDB Storage Engines

CONNECT

CONNECT storage engine

sudo apt-get install mariadb-plugin-connect
or sudo yum install MariaDB-connect-engine
MariaDB [mysql]> show plugins;

Archive

ARCHIVE storage engine

MariaDB [mysql]> INSTALL PLUGIN Archive SONAME 'ha_archive.so';

FederatedX

FederatedX Storage Engine

MariaDB [mysql]> INSTALL SONAME 'ha_federatedx';

MyRocks

MyRocks 是一个 MariaDB 存储引擎,它将 RocksDB 数据库添加到 MariaDB 中。RocksDB 是一个LSM数据库,具有很好的压缩比,针对闪存进行了优化。

sudo apt-get install mariadb-plugin-rocksdb
or sudo yum install MariaDB-rocksdb-engine
MariaDB [mysql]> INSTALL SONAME 'ha_rocksdb';
SHOW PLUGINS;
SHOW VARIABLES LIKE 'rocksdb_supported_compression_types';

Spider

Spider storage engine

Comparing Spider to Features in Other Databases

Database Feature
Oracle Database Links
Microsoft SQL Server Linked Servers
SAP/Sybase Remote Servers and Proxy Tables
PostgreSQL Foreign Data Wrappers
MySQL FEDERATED Storage Engine

Cassandra

Cassandra Storage Engine is no longer actively being developed and has been removed in MariaDB 10.6

ColumnStore

MariaDB ColumnStore

此列式存储是基于 InfiniDB 4.6.7 并移植到 MariaDB 的

Amazon

.NET

MaxScale

连接器

管理

Graphical and Enhanced Clients

解决方案

MariaDB-Galera-Cluster.png

High Availability & Performance Tuning replication, clustering, multi-master and performance tuning solutions. OLTP(InnoDB),OLAP(ColumnStore),HTAP(MaxScale)解决方案:

SkySQL

MariaDB Enterprise Server Storage Engines

Engine Target Optimization Availability
Aria Read-Heavy Reads ES10.2+
ColumnStore Analytics, HTAP Big Data, Analytical ES10.4+
InnoDB General Purpose Mixed Read/Write ES10.2+
MyISAM Reads Reads ES10.2+
MyRocks Write-Heavy I/O Reduction, SSD ES10.3+
S3 Cloud Read-Only ES10.3+
Spider Federation Sharding, Interlink ES10.3+
Xpand Distributed SQL Scale-Out, Fault Tolerance ES10.5+

GIS

Geographic & Geometric Features

安全加密

后端存储

书籍

用户

图集

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱