Share the installation process of the latest MySQL version 5.6.13 source code in CentOS _ MySQL

Source: Internet
Author: User
Tags crc32 automake
Share The CentOS installation process of the latest MySQL version 5.6.13 source code in CentOS.

BitsCN.com

Two months ago, the company withdrew the test server for the DBA and used a group of databases for development. some of the small functions that need to be tested need to be restarted constantly. in order not to affect the development colleagues, I have applied for another virtual machine and want to install the latest 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. install the cmake software package
Yum install cmake

3 create account of mysql
Groupadd mysql
Useradd-g 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 was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: cocould not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCCompiler. cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: cocould 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
-- Refreshing incomplete, errors occurred!

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

6. a cmake error was reported in the previous step. google learned that it was necessary to re-run the yum make command.

Yum install make
OK

Continue 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" was not found. Please set CMAKE_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 or name.
-- MySQL 5.6.13
-- Packaging as: mysql-5.6.13-Linux-x86_64
-- Cocould NOT find Threads (missing: Threads_FOUND)
-- Cocould NOT find Threads (missing: Threads_FOUND)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at/usr/share/cmake/Modules/TestBigEndian. cmake: 31 (MESSAGE ):
No suitable type found
Call Stack (most recent call first ):
Configure. cmake: 621 (TEST_BIG_ENDIAN)
CMakeLists.txt: 314 (INCLUDE)

This error is very strange. There are a lot of errors on google, but each case is different. I had to try them one by one.

-- Refreshing incomplete, errors occurred!

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

The following Error is reported: CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.
If gcc and gcc-c ++ are not installed, the following error is reported when you execute cmake:
First attempt, execute
Yum install-y gcc
Yum install-y gcc-c ++

OK, yum succeeded.

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
-- Cocould NOT find Threads (missing: Threads_FOUND)
-- Cocould NOT find Threads (missing: Threads_FOUND)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at/usr/share/cmake/Modules/TestBigEndian. cmake: 31 (MESSAGE ):
No suitable type found
Call Stack (most recent call first ):
Configure. cmake: 621 (TEST_BIG_ENDIAN)
CMakeLists.txt: 314 (INCLUDE)
-- Refreshing incomplete, errors occurred!

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

In the second attempt, some people said they needed to install at least five packages.
[Root @ 472322 mysql-5.6.13] #
Yum install 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

Then cmake again, or the original error is reported.

Finally, I decided to use the soil method. delete all installed ones and try again.

[Solution]: delete the original mysql-5.6.13 directory and decompress 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
-- Specify Ming Test HAVE_PEERCRED
-- Specify Ming Test HAVE_PEERCRED-Success
-- Library mysqlclient depends on OSLIBS-lpthread; m; rt; dl
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake.-DENABLE_DOWNLOADS = 1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy = http://foo.bar.com: 80
-- Library mysqlserver depends on OSLIBS-lpthread; m; rt; crypt; dl
-- Processing ing done
-- Generating done
-- Build files have been written to:/root/mysql-5.6.13

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

OK, it's a success. I'm not familiar with the underlying linux system. Is it because the cmake errors have not been installed in advance, which leads to continuous cmake errors? Is it necessary to prepare various lib packages before yum install cmake? And then install mysql to avoid the error?

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 (see documentation for more details ).
05:06:03 19416 [Note] InnoDB: The InnoDB memory heap is disabled
05:06:03 19416 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
05:06:03 19416 [Note] InnoDB: Compressed tables use zlib 1.2.3
05:06:03 19416 [Note] InnoDB: Using CPU crc32 instructions
05:06:03 19416 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
05:06:03 19416 [Note] InnoDB: Completed initialization of buffer pool
05:06:03 19416 [Note] InnoDB: The first specified data file./ibdata1 did not exist: a new database to be created!
05:06:03 19416 [Note] InnoDB: Setting file./ibdata1 size to 12 MB
05:06:03 19416 [Note] InnoDB: Database physically writes the file full: wait...
05:06:03 19416 [Note] InnoDB: Setting log file./ib_logfile101 size to 48 MB
05:06:03 19416 [Note] InnoDB: Setting log file./ib_logfile1 size to 48 MB
05:06:03 19416 [Note] InnoDB: Renaming log file./ib_logfile101 to./ib_logfile0
05:06:03 19416 [Warning] InnoDB: New log files created, LSN = 45781
05:06:03 19416 [Note] InnoDB: Doublewrite buffer not found: creating new
05:06:03 19416 [Note] InnoDB: Doublewrite buffer created
05:06:03 19416 [Note] InnoDB: 128 rollback segment (s) are active.
05:06:03 19416 [Warning] InnoDB: Creating foreign key constraint system tables.
05:06:03 19416 [Note] InnoDB: Foreign key constraint system tables created
05:06:03 19416 [Note] InnoDB: Creating tablespace and datafile system tables.
05:06:03 19416 [Note] InnoDB: Tablespace and datafile system tables created.
05:06:03 19416 [Note] InnoDB: Waiting for purge to start
05:06:03 19416 [Note] InnoDB: 5.6.13 started; log sequence number 0
05:06:04 19416 [Note] Binlog end
05:06:04 19416 [Note] InnoDB: FTS optimize thread exiting.
05:06:04 19416 [Note] InnoDB: Starting shutdown...
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 (see documentation for more details ).
05:06:05 19439 [Note] InnoDB: The InnoDB memory heap is disabled
05:06:05 19439 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
05:06:05 19439 [Note] InnoDB: Compressed tables use zlib 1.2.3
05:06:05 19439 [Note] InnoDB: Using CPU crc32 instructions
05:06:05 19439 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
05:06:05 19439 [Note] InnoDB: Completed initialization of buffer pool
05:06:05 19439 [Note] InnoDB: Highest supported file format is Barracuda.
05:06:05 19439 [Note] InnoDB: 128 rollback segment (s) are active.
05:06:05 19439 [Note] InnoDB: Waiting for purge to start
05:06:05 19439 [Note] InnoDB: 5.6.13 started; log sequence number 1625977
05:06:05 19439 [Note] Binlog end
05:06:05 19439 [Note] InnoDB: FTS optimize thread exiting.
05:06:05 19439 [Note] InnoDB: Starting shutdown...
05:06:06 19439 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

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:

/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 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:

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

You can test the MySQL daemon with mysql-test-run.pl

Cd mysql-test; perl mysql-test-run.pl

Please report any problems with the./bin/mysqlbug script!

The latest information about MySQL is available on the web

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
Will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file/etc/my. cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use
-- Defaults-file argument to mysqld_safe when starting the server

If the information is warning, run the command again. during The 5.6.10 installation test, the init db can run the command again no matter whether the first execution fails or succeeds.
[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 -- 1 root 1126 Aug 22 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 (see documentation for more details ).
05:07:31 19481 [Note] InnoDB: The InnoDB memory heap is disabled
05:07:31 19481 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
05:07:31 19481 [Note] InnoDB: Compressed tables use zlib 1.2.3
05:07:31 19481 [Note] InnoDB: Using CPU crc32 instructions
05:07:31 19481 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
05:07:31 19481 [Note] InnoDB: Completed initialization of buffer pool
05:07:31 19481 [Note] InnoDB: Highest supported file format is Barracuda.
05:07:31 19481 [Note] InnoDB: 128 rollback segment (s) are active.
05:07:31 19481 [Note] InnoDB: Waiting for purge to start
05:07:31 19481 [Note] InnoDB: 5.6.13 started; log sequence number 1625987
05:07:31 19481 [Note] Binlog end
05:07:31 19481 [Note] InnoDB: FTS optimize thread exiting.
05:07:31 19481 [Note] InnoDB: Starting shutdown...
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 (see documentation for more details ).
05:07:32 19505 [Note] InnoDB: The InnoDB memory heap is disabled
05:07:32 19505 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
05:07:32 19505 [Note] InnoDB: Compressed tables use zlib 1.2.3
05:07:32 19505 [Note] InnoDB: Using CPU crc32 instructions
05:07:32 19505 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
05:07:32 19505 [Note] InnoDB: Completed initialization of buffer pool
05:07:32 19505 [Note] InnoDB: Highest supported file format is Barracuda.
05:07:32 19505 [Note] InnoDB: 128 rollback segment (s) are active.
05:07:32 19505 [Note] InnoDB: Waiting for purge to start
05:07:32 19505 [Note] InnoDB: 5.6.13 started; log sequence number 1625997
05:07:32 19505 [Note] Binlog end
05:07:32 19505 [Note] InnoDB: FTS optimize thread exiting.
05:07:32 19505 [Note] InnoDB: Starting shutdown...
05:07:34 19505 [Note] InnoDB: Shutdown completed; log sequence number 1626007
OK

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:

/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 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:

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

You can test the MySQL daemon with mysql-test-run.pl

Cd mysql-test; perl mysql-test-run.pl

Please report any problems with the./bin/mysqlbug script!

The latest information about MySQL is available on the web

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 be in use, it was not replaced,
But was used in bootstrap (unless 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 you need.

WARNING: Default config file/etc/my. cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use
-- Defaults-file argument to mysqld_safe when starting the server

10 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

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

12 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) 2000,201 3, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be 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>

To sum up, I am not familiar with the linux underlying layer. Is it because the cmake errors have not been installed in advance, which leads to continuous errors reported by cmake? Is it necessary to prepare various lib packages before yum install cmake? And then install mysql to avoid the error?

You are welcome to give your valuable comments if you are familiar with the underlying linux environment or have experienced such experiences.

BitsCN.com

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.