Mysql compilation in windows _ MySQL

Source: Internet
Author: User
I 've been playing around with mysql compilation in windows for a long time today. I finally compiled mysql on windows and made a special record to share it with you.

I downloaded the mysql-5.5.13, after the download, open the INSTALL-WIN-SOURCE file under the root directory, which let me access the URL:

Http://dev.mysql.com/doc/refman/5.1/en/windows-source-build.html.

I followed what I said on the web page and found that I could not solve the problem. at the beginning, I had one step:

Cmake win/configure. js-XXX, why can't I go through it? later I found that there was no win/configure. js this file, in view of the above URL, in fact, said is the mysql-5.1.xx version of the method, I went, even compressed files in the file is not updated, and later found on the Internet, if you find the 5.5.xx document, follow this document.

Download the windows versions of cmake and bison, and double-click install cmake to add them to the environment variables. the default installation directory of bison is under program files, this should be changed to a path without parentheses in the middle. I directly installed it under drive C:/GnuWin32, and then added C:/GnuWin32/bin to the environment variable.

Enter the root directory of mysql and enter cmake.-G "Visual Studio 9 2008". if it is normal, there will be XXX done or something.

If it succeeds, MySQL will exist. sln and a bunch. vcproj file, open MySQL. sln, you can see the entire solution. before compiling, we recommend that you open the SQL/SQL _locale.cc file and save it again in UTF-8 format, otherwise there will be a lot of errors during the compilation process. Then we can generate a solution, but during the generation process, I will always come up with the linker to stop working or something. after the final compilation, there are a lot of problems with the link, and there will be fatal error LNK1000: internal error during IncrBuildImage: I encountered 23 errors, but I didn't change anything. I edited them again, ============ generated: 26 errors were successfully generated, 0 failed, the latest 62, skipped 10 =============, it seems that there is no error, and I don't know how the compiler works.

In addition to using sln for compilation, you can also use the command line for compilation. according to the document, the compilation Command is:

"C:/Program Files/Microsoft Visual Studio9.0/Common7/IDE/devenv.exe" MySQL. sln/build RelWithDebInfo,

The command for compiling the installation file is:

"C:/Program Files/Microsoft Visual Studio9.0/Common7/IDE/devenv.exe" MySQL. sln/build RelWithDebInfo/projectinitial_database

"C:/Program Files/Microsoft Visual Studio9.0/Common7/IDE/devenv.exe" MySQL. sln/build RelWithDebInfo/projectpackage

If you have no questions or documents, this command will generate the mysql-5.13-win32.zip file in the root directory.

The command for cleaning is

"C:/Program Files/Microsoft Visual Studio9.0/Common7/IDE/devenv.exe" MySQL. sln/clean

Del CMakeCache.txt

If there is an error in the initial_database project generated using sln, my solution is to set SQL/locale. in the my_locales struct under cc, all values except the first & my_locale_en_US and the last NULL are deleted (or commented out). It seems that I have no side effects after doing so, it seems that Chinese characters and Japanese characters are difficult to recognize.

Using the following parameters:

Mysqld-debug -- standalone.

Mysql with a window will appear. normally, it does not exist and can only be started in service mode.

Now you can debug it by appending vs to the process. we plan to write down how to debug mysql in windows next time.

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.