MySQL is an open-source database, so it can be installed based on the source code. Source code-based installation provides more flexibility. That is to say, we can select a suitable compiler for our hardware platform to optimize the compiled binary code and adjust the relevant compilation parameters according to the environment of different software platforms, select different installation components and set the desired character set. You can make various adjustments based on specific application scenarios. This article describes how to install MySQL in the source code mode.
1. installation environment and media
# Install media. You can download the installation media at the following URL. Select source code when downloading. The current version is 5.6.17.
# Source code Installation Method official website link: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html
2. System Requirements
Installation of MySQL from source requires several development tools. some of these tools are needed no matter whether you use a standard source distribution or a development source tree. other tool requirements depend on which installation method you use.
To install MySQL from source, your system must have the following tools, regardless of installation method:
CMake, which is used as the build framework on all platforms. CMake can be downloaded from http://www.cmake.org.A good make program. although some platforms come with their own make implementations, it is highly recommended that you use GNU make 3.75 or newer. it may already be available on your system as gmake. GNU make is available from http://www.gnu.org/software/make/.A working ansi c ++ compiler. GCC 4.2.1 or later, Sun Studio 12 or later, Visual Studio 2010 or later, and other current vendor-supplied compilers are known to work. perl is needed if you intend to run test scripts. most Unix-like systems include Perl. on Windows, you can use a version such as ActiveState Perl.
# Install the above development tools using the source code. The most important one is the Cmake tool. Generally, the OS is not installed and must be manually installed.
3. Install cmake
4. Install MySQL
..........
Remove CMakeCache.txt and rerun cmake. On Debian/Ubuntu, package name is libncurses5-dev,
# If the above error occurs during cmake, install the ncurses-devel rpmpackage and remove cmakecache.txt.
# If there is any corresponding OS installation CD, you can download this rpm package from the following link. Note that the corresponding version number should be consistent.
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # rm-rf CMakeCache.txt
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make
Linking CXX executable mysqltest_embedded
SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make install
..........
SZDB:/usr/local/mysql # chown-R root.
# Configure environment variables by using soft links or modifying environment variables (PATH = $ PATH:/usr/local/mysql/bin/; export PATH)
# Log on to mysql
Copyright (c) 2000,201 4, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> show databases;