Mariadb source code compilation process _ MySQL

Source: Internet
Author: User
Mariadb source code compilation process

Someone mentioned Mariadb on Weibo, searched for it, and found the address Alipay.

The current version is Mariadb 10.0.10. I have downloaded one to compile a 64-bit version ,:

Https://downloads.mariadb.org/mariadb/10.0.10/

Download the package and compile it with cmake. go to the cmake GUI and select vs12.0 win64 as the compiler.

Warning: Bison executable not found in PATH

This is a warning that Bison has not been installed. this software is in unix mode. you can skip this step in windows.

Generate in cmake to generate related files. The build directory is selected for the output:

Mariadb/mariadb-10.0.10/BUILD a bunch of stuff under the Directory

Select all build the cmake file.

Compilation error... SQL _local.cc compilation error, which is too common. it is the same as compiling mysql official version in the early stage. The processing method has long been easy to learn:

1) open SQL _local.cc with word and save it directly. at this time, the file header is added with invisible characters, indicating the utf8 encoded file;

2) modify the mysql. cc file, find the test_lc_time_sz () function, and comment out the statement DBUG_ASSERT (0 );

After the two modifications are completed, the compilation is successful.

After compilation, you can output the data to the install directory and directly execute the install command. Some tips are required to handle the install

Open the install project, which is actually a command line script, and copy it directly to complete 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: specify one
: CmErrorLevel
Exit/B % 1
: Shareone
If % errorlevel % neq 0 goto: VCEnd

Originally run cmake_install.cmake

Modify the output directory to F:/Program Files/MySQL (it is indeed C:/Program Files/MySQL, which is not very good on disk C)

Run the command line directly and find that a macro is not defined. add:

Added a row:
SET (CMAKE_INSTALL_CONFIG_NAME "Debug ")
There are also several PDBs that need to be manually copied, and then the installation is successful.

Run:
F:/Program Files/MySQL/bin
Mysqld -- console
F:/Program Files/MySQL/bin
Mysql-u root-p
You can create databases and tables.
Exit.
Mysqladmin-u root shutdown

Okay, everything is normal. you can continue to study MySQL later. In short, MariaDB is the same as mysql, and there is no difference in the compilation method.

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.