很多开发环境需要我们安装数据库,随着mysql的日渐衰弱,更多的开发环境使用mariadb作为数据库,而mariadb数据库目前没有os x的r
mariadb数据库管理系统是mysql的一个分支,主要由开源社区在维护,采用gpl授权许可 mariadb的目的是完全兼容mysql,包括api和命令行,,使之能轻松成为mysql的代替品。
很多开发环境需要我们安装数据库,随着mysql的日渐衰弱,更多的开发环境使用mariadb作为数据库,而mariadb数据库目前没有os x的release版本,所以我们需要手动编译安装
修改代码由于mariadb本身使用了tokudb的上游代码,而tokudb目前尚未有支持os x的计划,所以常规安装方式是不成功的,我们需要对代码本身进行修改。
由于是tokudb引擎导致的问题,所以只需要修改两个文件
storage/tokudb/ft-index/cmake_modules/tokusetupcompiler.cmake
-set(cmake_c_flags -wall -werror ${cmake_c_flags})-set(cmake_cxx_flags -wall -werror ${cmake_cxx_flags})+set(cmake_c_flags -wall ${cmake_c_flags})+set(cmake_cxx_flags -wall ${cmake_cxx_flags})storage/tokudb/ha_tokudb.cc
- extern const char * const tokudb_hton_name;
+ extern const char *tokudb_hton_name;
笔者猜测最根本的原因是tokudb没有对os x编译工具链做编译测试,os x的编译工具是llvm和bsd工具,而并非是gcc和gnu工具,所以在一些细节上有一些差别。如果没有改代码,会导致以下信息报错
[ 80%] building cxx object storage/tokudb/ft-index/locktree/cmakefiles/locktree_static.dir/locktree.cc.oin file included from /users/tangjiacheng/development/server/storage/tokudb/ft-index/locktree/locktree.cc:99:in file included from /users/tangjiacheng/development/server/storage/tokudb/ft-index/locktree/locktree.h:94:/users/tangjiacheng/development/server/storage/tokudb/ft-index/buildheader/db.h:323:1: error: empty c++ [-werror,-wextern-c-compat]struct __toku_db_lsn {^1 error generated.make[2]: *** [storage/tokudb/ft-index/locktree/cmakefiles/locktree_static.dir/locktree.cc.o] error 1make[1]: *** [storage/tokudb/ft-index/locktree/cmakefiles/locktree_static.dir/all] error 2make: *** [all] error 2和
in file included from /users/tangjiacheng/development/server/storage/tokudb/ha_tokudb.cc:8293:/users/tangjiacheng/development/server/storage/tokudb/hatoku_hton.cc:262:13: error: redefinition of 'tokudb_hton_name' with a different type: 'const char *'vs *tokudb_hton_name = tokudb;^/users/tangjiacheng/development/server/storage/tokudb/ha_tokudb.cc:382:31: note: previous definition is here* const tokudb_hton_name;注:至于一些朋友说homebrew install mariadb可以安装mariadb的说法,其实是因为homebrew本身修改过mariadb的代码,增加了一个cmake选项禁用了tokudb,而tokudb本身代码是没有问题的,因噎废食的做法笔者不敢苟同,所以还是原生编译安装更加实在。homebrew.mariadb
使用xtrabackup备份恢复mariadb数据库
在 centos/rhel/scientific linux 6 下安装 lamp (apache with mariadb and php)
mariadb proxy读写分离的实现
linux下编译安装配置mariadb数据库的方法
centos系统使用yum安装mariadb数据库
安装mariadb与mysql并存
ubuntu 上如何将 mysql 5.5 数据库迁移到 mariadb 10
[翻译]ubuntu 14.04 (trusty) server 安装 mariadb
mariadb 的详细介绍:请点这里
mariadb 的下载地址:请点这里
本文永久更新链接地址: