Source code compilation mysql-5.6.15

Source: Internet
Author: User

a . Environment Introduction

Operating System: CentOS6.4

two . installation software, source installation method

1.mysql Mounting Kit mysql-5.6.15.tar.gz cmake-2.8.4.tar.gz

MySQL:

50pxake installation package,mysql5.5 need cmake to compile later

1. CMake installation package cmake-2.8.4.tar.gz

Cmake:http://wwwNaNake.org/files/v2.8/cmake-2.8.4.tar.gz

three . Check whether you have installed RPM package of MySQL, if installed, uninstalled, so that the port is not occupied

Rpm–qa |grep MySQL

Rpm–e–nodeps MySQL or yum–y remove mysql*

four . Installing the Software

1. Install CMake First

TAR–AXF cmake-2.8.4.tar.gz

CD cmake-2.8.4

./configure

Make

Make install


2. Create MySQL users and user groups

Groupadd MySQL

Useradd–r–g MySQL MySQL


3. Compiling MySQL

TAR–AXF mysql-5.6.15.tar.gz

CD mysql-5.6.15

cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/mydata/data/-dwith_innobase_storage_engine=1- Dmysql_unix_addr=/usr/local/mysql/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_ General_ci

The above parameters and other instructions:

-dcmake_install_prefix=/usr/local/mysql#mysql installed home directory

-dmysql_datadir=/mydata/data/#mysql Database file storage directory

-dwith_innobase_storage_engine=1# Installing the InnoDB storage engine

-dmysql_unix_addr=/usr/local/mysql/mysql.sock# System Socket file (. sock) settings

-dmysql_user=mysql # default is User

-ddefault_charset=utf8 # using UTF8 characters

-ddefault_collation=utf8_general_ci# Check character


installation errors in the Mysql process:

3.1 does not have gcc and gcc-c++ installed

--The C compiler identification is unknown

--The CXX compiler identification is unknown

CMake error:your C Compiler: "Cmake_c_compiler-notfound" is not found. Setcmake_c_compiler to a valid COMPILER path or name.

CMake error:your CXX Compiler: "Cmake_cxx_compiler-notfound" was not found. Please set Cmake_cxx_compiler to a valid COMPILER path ORName.

Workaround:yum install–y gcc gcc-c++

3.2 not installed Bison

Warning:bison executable not found in PATH

Workaround: Install Bison

Yum Install Bison

RM CMakeCache.txt

NOTE: Recompile to remove CMakeCache.txt file, otherwise you will get an error

3.3 not installed ncurses

RemoveCMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.

workaround : Yum install–y ncurses-devel


4. Initializing the database

4.1 to the installation directory and data storage directory MySQL permissions

Chown-r mysql/mydata/data/

Chown-r mysql/usr/local/mysql/


4.2 When initializing the database, please look at the information that pops up so that there is no error.

Scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/mydata/data/--defaults-file=/etc/ My.cnf


Five Add power-on self-boot

CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MYSQL.SERVER/ETC/INIT.D/MYSQLD # Copying the startup item file

Chkconfig--add mysqld

Chkconfig--level 123456 mysqld on


1. start the MySQL times error

Service mysqld Start

Starting MySQL .... error! Theserver quit without updating PID file (/var/lib/mysql/nginx.server.com.pid).

Workaround: Check the MySQL log (mysql log file where you can see the my.cnf file,my.cnf generally /etc/ under or in the directory where MySQL is installed )

/var/log/mysqld.log error message :[error]fatal error:can ' t open and Lock Privilege tables:table ' mysql.user ' doesn ' Texist

When I look at the my.cnf file, I find that the path of DataDir is different from my compilation, instead datadir=/mydata/data/

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/B9/wKiom1WDxM7wxqejAAEFy9c1-q8547.jpg "title=" QQ picture 20150619152857.png "alt=" Wkiom1wdxm7wxqejaaefy9c1-q8547.jpg "/>


Start MySQL Success

Service mysqld Start

Starting MySQL success!

view MySQL port

[[email protected] log]# NETSTAT-NTLP |grep mysqld

TCP 0 0::: 3306:::* LISTEN 35119/mysqld [[email protected] mysq l]# bin/mysqladmin-u root passwd ' 123 '

2. set the MySQL password

mysqladmin-u root password ' [email protected] '

The installation is complete ........

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/B6/wKioL1WDxxHCdjT8AAEz_Y4DoDA491.jpg "title=" QQ picture 20150619153124.png "alt=" Wkiol1wdxxhcdjt8aaez_y4doda491.jpg "/>





This article is from the "Fingertip Chou Yang" blog, please be sure to keep this source http://766792592.blog.51cto.com/8308325/1663583

Source code compilation mysql-5.6.15

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.