OS X compilation and installation of MariaDB
The MariaDB database management system is a branch of MySQL and is mainly maintained by the open-source community. The purpose of using GPL to authorize MariaDB is to be fully compatible with MySQL, including APIs and command lines, it can easily become a substitute for MySQL.
Many development environments require us to install databases. As mysql becomes increasingly weak, more development environments use mariadb as the database, while mariadb does not currently have the OS X release version, therefore, we need to manually compile and install
Modify code
Because mariadb uses the upstream code of tokudb, and tokudb does not yet have a plan to support OS X, the general installation method is not successful. We need to modify the Code itself.
Because it is caused by the tokudb engine, you only need to modify two files
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;
I guess the most fundamental reason is that tokudb did not perform a compilation test on the OS x compilation tool chain. OS X compilation tools are LLVM and BSD tools, not gcc and GNU tools, so there are some differences in some details. If the code is not changed, the following error message is returned:
[ 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 struct has size 0 in C, size 1 in 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
And
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 'const char *const'const char *tokudb_hton_name = "TokuDB";^/Users/tangjiacheng/Development/server/storage/tokudb/ha_tokudb.cc:382:31: note: previous definition is hereextern const char * const tokudb_hton_name;
Note: Some friends sayhomebrew install mariadb
Mariadb can be installed because homebrew has modified the mariadb code and added a cmake option to disable tokudb, while the Code of tokudb itself is no problem. I am not sure about this practice, therefore, native compilation and installation are more practical. Homebrew. mariadb
Use XtraBackup to back up and restore the MariaDB Database
Install LAMP (Apache with MariaDB and PHP) in CentOS/RHEL/Scientific Linux 6)
Implementation of MariaDB Proxy read/write splitting
How to compile and install the MariaDB database in Linux
Install MariaDB database using yum in CentOS
Install MariaDB and MySQL
How to migrate MySQL 5.5 database to MariaDB 10 on Ubuntu
Install MariaDB on the Ubuntu 14.04 (Trusty) Server