OSX compilation and installation of MariaDB

Source: Internet
Author: User
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 an OSX r

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 have OS X r at present.

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:

[2, 80%] Building CXX object storage/tokudb/ft-index/locktree/CMakeFiles/locktree_static.dir/locktree. cc. oIn file stored ded from/Users/tangjiacheng/Development/server/storage/tokudb/ft-index/locktree. cc: 99: In file stored ded from/Users/tangjiacheng/Development/server/storage/tokudb/ft-index/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 1 make [1]: *** [storage/tokudb/ft-index/locktree/CMakeFiles/locktree_static.dir/all] Error 2 make: * ** [all] Error 2

And

In file included from/Users/tangjiacheng/Development/server/storage/tokudb/ha_tokudb.cc: 8293:/Users/tangjiacheng/Development/server/storage/tokudb/Timeout: 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;

Note: Some friends say that homebrew install mariadb can install mariadb because homebrew has modified the mariadb code and added a cmake option to disable tokudb, the Code of tokudb itself is correct. I am not sure about the practices of using tokudb, so native compilation and installation are more realistic. 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

MariaDB details: click here
MariaDB's: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.