Share CentOS Mysql Latest version 5.6.13 source installation process _mysql

Source: Internet
Author: User
Tags crc32 deprecated documentation mysql latest version prepare rollback automake

2 months ago, the company's test server to the DBA was retracted, have been with the development of a group of DB, some need to test the small features, the need to constantly restart the DB, in order not to affect the development colleagues, they have applied for a virtual machine, ready to install the latest version of the MySQL community version 5.6.13.

1 Download the tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://cdn.mysql.com/

2 Installing CMake Packages
Yum Install CMake

3 Create account of MySQL
Groupadd MySQL
useradd-g MySQL MySQL
autoreconf--force--install
Libtoolize--automake--force
Automake--force--add-missing

4 Complie The sources
Mkdir-p/data/mbdata
TAR-XVF mysql-5.6.13.tar.gz

5 CMake

Time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci

[root@472322 mysql-5.6.13]# time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci


--Running CMake version 2.6.4


CMake Error:cmake is unable to find a builds program corresponding to "Unix makefiles".  Cmake_make_program is not set. You are probably need to select a different build tool.


CMake Error:error Required Internal CMake variable not set, CMake the May is not is built correctly.


Missing variable is:


Cmake_c_compiler_env_var


CMake Error:error Required Internal CMake variable not set, CMake the May is not is built correctly.


Missing variable is:


Cmake_c_compiler


CMake error:could not find CMake module File:/root/mysql-5.6.13/cmakefiles/cmakeccompiler.cmake


CMake Error:error Required Internal CMake variable not set, CMake the May is not is built correctly.


Missing variable is:


Cmake_cxx_compiler_env_var


CMake Error:error Required Internal CMake variable not set, CMake the May is not is built correctly.


Missing variable is:


Cmake_cxx_compiler


CMake error:could not find CMake module File:/root/mysql-5.6.13/cmakefiles/cmakecxxcompiler.cmake


CMake Error:cmake_c_compiler not set, after Enablelanguage


CMake Error:cmake_cxx_compiler not set, after Enablelanguage


--Configuring incomplete, Errors occurred!

Real 0m0.017s
User 0m0.006s
SYS 0m0.005s

6 The previous step cmake the error, Google learned that need to Yum make

Yum Install make
Ok

And go on to CMake.


[root@472322 mysql-5.6.13]# time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci


--Running CMake version 2.6.4


--The C compiler identification is unknown


--The CXX compiler identification is unknown


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


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


--MySQL 5.6.13


--Packaging as:mysql-5.6.13-linux-x86_64


--Could not find Threads (missing:threads_found)


--Could not find Threads (missing:threads_found)


--Check If the system is big endian


--Searching bit integer


CMake Error at/usr/share/cmake/modules/testbigendian.cmake:31 (message):


No suitable type found


Call Stack (most recent call i):


configure.cmake:621 (Test_big_endian)


cmakelists.txt:314 (INCLUDE)

It's a weird mistake, Google has a lot on it, but every situation is different.

--Configuring incomplete, Errors occurred!

Real 0m0.122s
User 0m0.067s
SYS 0m0.048s
[root@472322 mysql-5.6.13]#

The error is as follows: CMake error:your C Compiler: "Cmake_c_compiler-notfound" is not found.
Failed to install GCC and gcc-c++, execution CMake reported as error:
First attempt, execution
Yum install-y gcc
Yum Install-y gcc-c++

Ok,yum success

7 Continue CMake

Time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci

[root@472322 mysql-5.6.13]#


Time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci


--Running CMake version 2.6.4


--The C compiler identification is GNU


--The CXX compiler identification is GNU


--Check for working C compiler:/USR/BIN/GCC


--Check for working C compiler:/USR/BIN/GCC--Works


--Detecting C compiler ABI Info


--Detecting C compiler ABI Info-done


--Check for working CXX compiler:/usr/bin/c++


--Check for working CXX compiler:/usr/bin/c++--Works


--Detecting CXX compiler ABI Info


--Detecting CXX compiler ABI Info-done


--MySQL 5.6.13


--Packaging as:mysql-5.6.13-linux-x86_64


--Could not find Threads (missing:threads_found)


--Could not find Threads (missing:threads_found)


--Check If the system is big endian


--Searching bit integer


CMake Error at/usr/share/cmake/modules/testbigendian.cmake:31 (message):


No suitable type found


Call Stack (most recent call i):


configure.cmake:621 (Test_big_endian)


cmakelists.txt:314 (INCLUDE)


--Configuring incomplete, Errors occurred!

Real 0m0.510s
User 0m0.275s
SYS 0m0.112s

Second attempt, some people say that they need to install at least 5 kinds of packages
[root@472322 mysql-5.6.13]#
Yum Install gcc gcc-c++
Yum Install-y ncurses-devel.x86_64
Yum Install-y cmake.x86_64
Yum Install-y libaio.x86_64
Yum Install-y bison.x86_64
Yum Install-y gcc-c++.x86_64

And then CMake, or report the original mistake

Finally decided to use the Earth method, delete all the installed, and again to do it again.

[Workaround]: Delete the original mysql-5.6.13 directory and unzip the tar.gz package

rm-rf/root/mysql-5.6.13


cd/root/


TAR-XVF mysql-5.6.13.tar.gz


cd/root/mysql-5.6.13


Time CMake. -dcmake_install_prefix=/usr/local/mysql56-dmysql_datadir=/data56-dwith_innobase_storage_engine=1-dmysql_unix_ Addr==/data56/mysql.sock-dmysql_user=mysql-ddefault_charset=utf8-ddefault_collation=utf8_general_ci


........


--Looking for asprintf


--Looking for Asprintf-found


--Check size of pthread_t


--Check size of Pthread_t-done


--Using CMake version 2.6.4


--Not building NDB


--Performing Test have_peercred


--Performing Test have_peercred-success


--Library mysqlclient depends on OSLIBS-LPTHREAD;M;RT;DL


--Googlemock is not found. Gtest-based unit tests would be disabled. You can run CMake. -denable_downloads=1 to automatically download and builds required components from source.


--If you are are inside a firewall, you could need to use an HTTP Proxy:export http_proxy=http://foo.bar.com:80


--Library MySQLServer depends on OSLIBS-LPTHREAD;M;RT;CRYPT;DL


--Configuring done


--Generating done


--Build the files have been written to:/root/mysql-5.6.13

Real 0m23.413s
User 0m13.815s
SYS 0m7.419s

OK, successful, not very familiar with the bottom of Linux, is it because the front did not install all kinds of packages and cmake out the wrong things cause the back continues to cmake the error? Is it necessary to prepare all kinds of LIB packages before Yum install CMake? And then install MySQL to not complain?

8 Build the DB directy
Time make
Time make Install

9 Init db


ll/usr/local/mysql56/


cd/usr/local/mysql56/


Chown-r MySQL.


Chgrp-r MySQL.


CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY56.CNF


scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql56--datadir=/data56--defaults-file=/etc/my56.cnf


[root@472322 mysql56]# scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql56--datadir=/data56-- Defaults-file=/etc/my56.cnf


Installing MySQL system tables ... 2013-08-22 05:06:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for more details).


2013-08-22 05:06:03 19416 [note] innodb:the InnoDB memory heap is disabled


2013-08-22 05:06:03 19416 [note] innodb:mutexes and rw_locks use GCC atomic builtins


2013-08-22 05:06:03 19416 [note] innodb:compressed tables use zlib 1.2.3


2013-08-22 05:06:03 19416 [note] innodb:using CPU CRC32 Instructions


2013-08-22 05:06:03 19416 [note] innodb:initializing buffer pool, size = 128.0M


2013-08-22 05:06:03 19416 [note] innodb:completed initialization of buffer pool


2013-08-22 05:06:03 19416 [note] Innodb:the the specified of the new database to is/IBDATA1 not did the data file. exist:a ed!


2013-08-22 05:06:03 19416 [note] innodb:setting file./ibdata1 size to MB


2013-08-22 05:06:03 19416 [note] Innodb:database physically writes the file full:wait ...


2013-08-22 05:06:03 19416 [note] innodb:setting log file./ib_logfile101 size to MB


2013-08-22 05:06:03 19416 [note] innodb:setting log file./ib_logfile1 size to MB


2013-08-22 05:06:03 19416 [note] innodb:renaming log file./ib_logfile101 to./ib_logfile0


2013-08-22 05:06:03 19416 [Warning] innodb:new log files created, lsn=45781


2013-08-22 05:06:03 19416 [note] innodb:doublewrite buffer not found:creating new


2013-08-22 05:06:03 19416 [note] Innodb:doublewrite buffer created


2013-08-22 05:06:03 19416 [note] innodb:128 rollback segment (s) are active.


2013-08-22 05:06:03 19416 [Warning] innodb:creating FOREIGN KEY constraint system tables.


2013-08-22 05:06:03 19416 [note] innodb:foreign key constraint system tables created


2013-08-22 05:06:03 19416 [note] innodb:creating tablespace and datafile system tables.


2013-08-22 05:06:03 19416 [note] innodb:tablespace and datafile system tables created.


2013-08-22 05:06:03 19416 [note] innodb:waiting for purge to start


2013-08-22 05:06:03 19416 [note] innodb:5.6.13 started; Log sequence number 0


2013-08-22 05:06:04 19416 [note] Binlog end


2013-08-22 05:06:04 19416 [note] innodb:fts optimize thread exiting.


2013-08-22 05:06:04 19416 [note] innodb:starting shutdown ...


2013-08-22 05:06:05 19416 [note] Innodb:shutdown completed; Log sequence Number 1625977


Ok

Filling Help Tables ... 2013-08-22 05:06:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for more details).


2013-08-22 05:06:05 19439 [note] innodb:the InnoDB memory heap is disabled


2013-08-22 05:06:05 19439 [note] innodb:mutexes and rw_locks use GCC atomic builtins


2013-08-22 05:06:05 19439 [note] innodb:compressed tables use zlib 1.2.3


2013-08-22 05:06:05 19439 [note] innodb:using CPU CRC32 Instructions


2013-08-22 05:06:05 19439 [note] innodb:initializing buffer pool, size = 128.0M


2013-08-22 05:06:05 19439 [note] innodb:completed initialization of buffer pool


2013-08-22 05:06:05 19439 [note] innodb:highest supported the file format is barracuda.


2013-08-22 05:06:05 19439 [note] innodb:128 rollback segment (s) are active.


2013-08-22 05:06:05 19439 [note] innodb:waiting for purge to start


2013-08-22 05:06:05 19439 [note] innodb:5.6.13 started; Log sequence Number 1625977


2013-08-22 05:06:05 19439 [note] Binlog end


2013-08-22 05:06:05 19439 [note] innodb:fts optimize thread exiting.


2013-08-22 05:06:05 19439 [note] innodb:starting shutdown ...


2013-08-22 05:06:06 19439 [note] Innodb:shutdown completed; Log sequence Number 1625987


Ok

To start mysqld at boot time and 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 did so, start the server, then issue the following commands:

/usr/local/mysql56/bin/mysqladmin-u root password ' new-password '
/usr/local/mysql56/bin/mysqladmin-u root-h 472322.ea.com password ' new-password '

Alternatively you can run:

/usr/local/mysql56/bin/mysql_secure_installation

Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.

The manual for more instructions.

Can start the MySQL daemon with:

Cd. ; /usr/local/mysql56/bin/mysqld_safe &

Can test the MySQL daemon with mysql-test-run.pl

CD mysql-test; Perl mysql-test-run.pl

Please have a problems with the/bin/mysqlbug script!

The latest information about the MySQL is available on the Web at

Http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New Default Config file was created as/usr/local/mysql56/my.cnf and
'll be used by default by the server when you start it.
You could edit this file to the Change server settings

Warning:default config FILE/ETC/MY.CNF exists on the system
This file would be read by default by the MySQL server
If you don't want to use this, either remove it, or use the
--defaults-file argument to Mysqld_safe when starting the server

Feel the information is warning, then do it again, originally in doing 5.6.10 installation test, init DB regardless of the first execution failure or success, can be executed the second time.


[root@472322 mysql56]#


[root@472322 mysql56]# ll ETC/MY56.CNF


Ls:cannot access etc/my56.cnf:no such file or directory


[root@472322 mysql56]# ll/etc/my56.cnf


-rw-r--r--1 root root 1126 Aug 05:05/etc/my56.cnf


[root@472322 mysql56]# scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql56--datadir=/data56-- Defaults-file=/etc/my56.cnf


Installing MySQL system tables ... 2013-08-22 05:07:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for more details).


2013-08-22 05:07:31 19481 [note] innodb:the InnoDB memory heap is disabled


2013-08-22 05:07:31 19481 [note] innodb:mutexes and rw_locks use GCC atomic builtins


2013-08-22 05:07:31 19481 [note] innodb:compressed tables use zlib 1.2.3


2013-08-22 05:07:31 19481 [note] innodb:using CPU CRC32 Instructions


2013-08-22 05:07:31 19481 [note] innodb:initializing buffer pool, size = 128.0M


2013-08-22 05:07:31 19481 [note] innodb:completed initialization of buffer pool


2013-08-22 05:07:31 19481 [note] innodb:highest supported the file format is barracuda.


2013-08-22 05:07:31 19481 [note] innodb:128 rollback segment (s) are active.


2013-08-22 05:07:31 19481 [note] innodb:waiting for purge to start


2013-08-22 05:07:31 19481 [note] innodb:5.6.13 started; Log sequence Number 1625987


2013-08-22 05:07:31 19481 [note] Binlog end


2013-08-22 05:07:31 19481 [note] innodb:fts optimize thread exiting.


2013-08-22 05:07:31 19481 [note] innodb:starting shutdown ...


2013-08-22 05:07:32 19481 [note] Innodb:shutdown completed; Log sequence Number 1625997


Ok

Filling Help Tables ... 2013-08-22 05:07:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for more details).


2013-08-22 05:07:32 19505 [note] innodb:the InnoDB memory heap is disabled


2013-08-22 05:07:32 19505 [note] innodb:mutexes and rw_locks use GCC atomic builtins


2013-08-22 05:07:32 19505 [note] innodb:compressed tables use zlib 1.2.3


2013-08-22 05:07:32 19505 [note] innodb:using CPU CRC32 Instructions


2013-08-22 05:07:32 19505 [note] innodb:initializing buffer pool, size = 128.0M


2013-08-22 05:07:32 19505 [note] innodb:completed initialization of buffer pool


2013-08-22 05:07:32 19505 [note] innodb:highest supported the file format is barracuda.


2013-08-22 05:07:32 19505 [note] innodb:128 rollback segment (s) are active.


2013-08-22 05:07:32 19505 [note] innodb:waiting for purge to start


2013-08-22 05:07:32 19505 [note] innodb:5.6.13 started; Log sequence Number 1625997


2013-08-22 05:07:32 19505 [note] Binlog end


2013-08-22 05:07:32 19505 [note] innodb:fts optimize thread exiting.


2013-08-22 05:07:32 19505 [note] innodb:starting shutdown ...


2013-08-22 05:07:34 19505 [note] Innodb:shutdown completed; Log sequence Number 1626007


Ok

To start mysqld at boot time and 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 did so, start the server, then issue the following commands:

/usr/local/mysql56/bin/mysqladmin-u root password ' new-password '
/usr/local/mysql56/bin/mysqladmin-u root-h 472322.ea.com password ' new-password '

Alternatively you can run:

/usr/local/mysql56/bin/mysql_secure_installation

Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.

The manual for more instructions.

Can start the MySQL daemon with:

Cd. ; /usr/local/mysql56/bin/mysqld_safe &

Can test the MySQL daemon with mysql-test-run.pl

CD mysql-test; Perl mysql-test-run.pl

Please have a problems with the/bin/mysqlbug script!

The latest information about the MySQL is available on the Web at

Http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Warning:found existing config file/usr/local/mysql56/my.cnf on the system.
Because this file might is in use, it is not replaced,
But is used in bootstrap (unless for you used--defaults-file)
And when you later start the server.
The new default Config file was created as/usr/local/mysql56/my-new.cnf,
Please compare it with your file and take the changes your need.

Warning:default config FILE/ETC/MY.CNF exists on the system
This file would be read by default by the MySQL server
If you don't want to use this, either remove it, or use the
--defaults-file argument to Mysqld_safe when starting the server

Copy Start command

CP support-files/mysql.server/etc/init.d/mysqld56
chmod 700/etc/init.d/mysqld56
echo "Export path= $PATH:/usr/local/mysql56/bin" >>/etc/profile
Source/etc/profile

Add command to system parameter
Cd/data56
Chkconfig--add mysqld56

Start Service & Check & Login
Service mysqld56 Start

[root@472322 data56]# Service mysqld56 start
Starting MySQL. success!
[root@472322 data56]# MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.6.13 Source Distribution

Copyright (c), 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark the Oracle Corporation and/or its
Affiliates. Names may trademarks of their respective
Owners.

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)

Mysql>

Summary question: The Linux bottom is not too familiar with, is because the front did not install all kinds of packages and cmake out the wrong things cause behind continue to cmake the error? Is it necessary to prepare all kinds of LIB packages before Yum install CMake? And then install MySQL to not complain?

Welcome friends who are familiar with the bottom of Linux or have experience in this area to give valuable advice.

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.