SUSE Linux source code compilation and installation MySQL 5.6, susemysql

Source: Internet
Author: User

SUSE Linux source code compilation and installation MySQL 5.6, susemysql

This article mainly introduces how to install MySQL 5.6 in SUSE Linux Source Code compiling mode. This article uses SUSE Linux Enterprise Server 10 SP3 (x86_64) system. For more information, see. 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

SZDB :~ # Cat/etc/issueWelcome to SUSE Linux Enterprise Server 10 SP3 (x86_64)-Kernel \ r (\ l). SZDB :~ # Uname-aLinux SZDB 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux # The installation media can be downloaded at the following URL, pay attention to the download select source code, the current version is 5.6.17 # according to your own environment to download the corresponding installation media, this article demonstrates the installation media is Generic Linux (Architecture Independent), mysql-5.6.17.tar.gzhttp: // dev.mysql.com/downloads/mysql?source code installer official website link: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html

2. System Requirements

Source Installation 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 yo Ur 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. # Use the source code to install the above Some development tools are required. The most important one is the Cmake tool. Generally, the OS is not installed and must be manually installed. # If no cmake is available, this error message is displayed: (-bash: cmake: command not found)

3. Install cmake

# You can download cmake here. Here I download version 2.6.4.

http://www.cmake.org/cmake/resources/software.htmlSZDB:~ # cd /usr/local/src/mysql_srcSZDB:/usr/local/src/mysql_src # tar -xvf cmake-2.6.4.tar.gzSZDB:/usr/local/src/mysql_src # cd cmake-2.6.4SZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./bootstrap  SZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./makeSZDB:/usr/local/src/mysql_src/cmake-2.6.4 # ./make install

4. Install MySQL

SZDB :~ # Groupadd mysqlSZDB :~ # Useradd-r-g mysql mysqlSZDB :~ # Cd/usr/local/src/mysql_srcSZDB:/usr/local/src/mysql_src # tar-xvf mysql-5.6.17.tar.gz SZDB:/usr/local/src/mysql_src # lsmysql-5.6.17 mysql-5.6.17.tar.gzSZDB: /usr/local/src/mysql_src # cd mysql-5.6.17/SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # cmake ........... -- Check size of wint_t-done -- cocould NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline. Cmake: 85 (MESSAGE): Author: Leshami Curses library not found. please install appropriate package, Blog: http://blog.csdn.net/leshami remove CMakeCache.txt and rerun cmake. on Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. call Stack (most recent call first): cmake/readline. cmake: 128 (FIND_CURSES) cmake/readline. cmake: 202 (MYSQL_USE_BUNDLED_EDITLINE) CM AkeLists.txt: 411 (MYSQL_CHECK_EDITLINE) # If the above error occurs during cmake, install the ncurses-devel rpmpackage, and then remove the cmakecache.txt -- processing incomplete, errors occurred! # If there is no corresponding OS installation disc, you can download this rpm package from the following link, pay attention to the corresponding version number should be consistent with the http://www.filewatcher.com/m/ncurses-devel-5.5-18.11.x86_64.rpm.735840-0.htmlSZDB:/usr/local/src/mysql_src # rpm-Uvh ncurses-devel-5.5-18.11.x86_64.rpmPreparing... ######################################## ### [100%] 1: ncurses-devel ##################################### ###### [1, 100%] SZDB: /usr/local/src/mysql_src/mysql-5.6.17 # rm-rf CMakeCache.txt SZDB:/usr/ Local/src/mysql_src/mysql-5.6.17 # cmake. # execute cmake again ........ -- Library mysqlserver depends on OSLIBS-lpthread; m; rt; crypt; dl; aio -- Generating ing done -- Generating done -- Build files have been written: /usr/local/src/mysql_src/mysql-5.6.17SZDB:/usr/local/src/mysql_src/mysql-5.6.17 # make Linking CXX executable mysqltest_embedded [100%] Built target mysqltest_embedded Scanning dependencies Target my_safe_process [100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/login Linking CXX executable my_safe_process [100%] Built target my_safe_processSZDB: /usr/local/src/mysql_src/mysql-5.6.17 # make installSZDB:/usr/local/src/mysql_src/mysql-5.6.17 # cd/usr/local/mysqlSZDB: /usr/local/mysql # chown-R mysql. SZDB:/usr/local/mysql # chgrp-R my SQL. SZDB:/usr/local/mysql # scripts/mysql_install_db -- user = mysql .......... to start mysqld at boot time you have to copy support-files/mysql. server to the right place for your system please remember to set a password for the MySQL root USER! To do so, start the server, then issue the following commands :. /bin/mysqladmin-u root password 'new-password '. /bin/mysqladmin-u root-h SZDB password 'new-password' Alternatively you can run :. /bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. this is stronugly recommended for production servers. see the manual for more instructions.
You can start the MySQL daemon with: cd .;. /bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test; perl mysql-test-run.plNew default config file was created. /my. cnf andwill be used by default by the server when you start it. you may edit this file to change server settings .......... SZDB:/usr/local/mysql # chown-R root. SZDB:/usr/local/mysql # chown-R mysql dat A SZDB:/usr/local/mysql # cp support-files/mysql. server/etc/init. d/mysql. server # configure self-startup SZDB:/usr/local/mysql # cp support-files/my-default.cnf/etc/my. cnf # Add the default my. cnf configuration file SZDB:/usr/local/mysql # bin/mysqld_safe -- user = mysql & # Starting mysql [1] 21004 SZDB: /usr/local/mysql #140521 02:54:54 mysqld_safe Logging to '/usr/local/mysql/data/SZDB. err '. 140521 02:54:54 mysqld_safe Starting mysqld daemon with data Bases from/usr/local/mysql/data # configure environment variables by using soft links or modifying environment variables (PATH = $ PATH:/usr/local/mysql/bin /; export PATH) SZDB :~ # Ln-fs/usr/local/mysql/bin/mysql/usr/local/bin SZDB :~ # Ln-fs/usr/local/mysql/bin/mysqladmin/usr/local/bin SZDB :~ # Ln-fs/usr/local/mysql/bin/mysqld_safe/usr/local/bin # log on to mysqlSZDB:/usr/local/bin # mysql-urootWelcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 1 Server version: 5.6.17 Source distributionCopyright (c) 2000,201 4, Oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. other names may be trademarks of their respectiveowners. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> show databases; + -------------------- + | Database | + -------------------- + | information_schema | mysql | performance_schema | test | + -------------------- + 4 rows in set (0.00 sec)


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.