手把手教你编译安装MariaDB

Posted 丛立

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了手把手教你编译安装MariaDB相关的知识,希望对你有一定的参考价值。

MariaDB是什么?

MariaDB是mysql的一个分支,由于Oracle有可能对MySQL闭源,所以分离了出来(MySQL先后被Sun、Oracle收购)。

但是除了作为一个Mysql的“向下替代品”,MariaDB包括的一些新特性使它优于MySQL。

官网说明

The instructions on this page will help you compile MariaDB from source. Links to more complete instructions for specific platforms can be found on the source page.

First, get a copy of the MariaDB source.

Next, prepare your system to be able to compile the source.

If you don‘t want to run MariaDB as yourself, then you should create amysql user. The example below uses this user.

Using cmake (MariaDB starting with 5.5)

MariaDB 5.5 and above is compiled using cmake. You can configure your build simply by running cmake without any special options, like

cmake .

but if you want it to be configured exactly as we do for our releases, use

cmake . -DBUILD_CONFIG=mysql_release

All cmake configuration options for MariaDB can be displayed with:

cmake . -LH

To build and install MariaDB after running cmake use

make
sudo make install

If the commands above fail, you can enable more compilation information by doing:

make VERBOSE=1

以上摘自:https://mariadb.com/kb/en/mariadb/generic-build-instructions/

cmake的选项和mysql的cmake相似,可供参考(中文文档):http://www.blogjava.net/kelly859/archive/2012/09/04/387005.html

测试实践

编译实践

#解压

tar xfz mariadb-10.0.16.tar.gz

  #进入安装目录

cd mariadb

 #配置 

cmake . -DCMAKE_INSTALL_PREFIX=/opt/waTeam/mariadb -DMYSQL_DATADIR=/home/datas/mariadb/data/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

 
#编译 约半小时时间

make

 #安装

 
make install
 至此,MariaDB编译安装完成。

以上是关于手把手教你编译安装MariaDB的主要内容,如果未能解决你的问题,请参考以下文章

手把手教你在Linux(Deepin)安装MySQL和MariaDB

手把手教你使用 Prometheus 监控 MySQL 与 MariaDB.md

手把手教你搞懂 Android 反编译

手把手教你搞懂 Android 反编译

手把手教你搞懂 Android 反编译

云计算的1024种玩法手把手教你如何编译升级 OpenResty