MARIADB source code compilation process

Source: Internet
Author: User

From the microblog saw someone mention mariadb, search for a bit, find address https://mariadb.org/, this is a branch of MySQL, by the original author maintenance, intended to rival Oracle, to avoid Oracle future source.

Currently version mariadb 10.0.10, I downloaded a, ready to compile a 64-bit version:

https://downloads.mariadb.org/mariadb/10.0.10/

After downloading with CMake compile a try, enter CMake GUI, compiler chooses vs12.0 Win64

Warning:bison executable not found in PATH

This is a warning not installed Bison, this software is under the UNIX, Windows can not install, ignore.

Generate in CMake to generate the relevant files. The output has the build directory selected:

Mariadb\mariadb-10.0.10\build directory under a bunch of stuff

Select all to build this CMake file to try.

Compile error ... sql_local.cc compile errors, too common, as in the pre-compiled MySQL official version. The way it's handled is already familiar:

1) Open sql_local.cc with Word, directly save can, at this time the file header, was added the invisible character, marked UTF8 encoded file;

2) Modify the mysql.cc file, locate the TEST_LC_TIME_SZ () function, comment out the statement dbug_assert (0);

After these two modifications are complete, the compilation succeeds.


After compiling can output to the install directory, directly execute install failure, need some tricks to handle the install

Open the install project, inside is actually a command line script, directly copy out to finish Doinstall.bat

Setlocal
"C:\Program Files (x86) \cmake 2.8\bin\cmake.exe"-dbuild_type=$ (Configuration)-P Cmake_install.cmake
If%errorlevel% NEQ 0 goto:cmend
: Cmend
Endlocal & call:cmerrorlevel%errorlevel% & Goto:cmdone
: Cmerrorlevel
Exit/b%1
: Cmdone
If%errorlevel% NEQ 0 goto:vcend

It turned out to be cmake_install.cmake.

Modify the output directory to: F:\Program files\mysql (really C:\Program files\mysql, not very good in the C-drive)

Direct command line execution, found that there is a macro is not defined, add:

Added a line:
SET (cmake_install_config_name "Debug")
There are several PDB that need to be copied manually, and then the install succeeds.

Run Try:
F:\Program Files\mysql\bin
Mysqld--console
F:\Program Files\mysql\bin
Mysql-u root-p
You can already create a database and a table.
Exit.
Mysqladmin-u Root shutdown


OK, everything is fine, you can continue to study MySQL later. In short, mariadb and MySQL homologous, the compilation method is similar, no difference.

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.