MySQL 5.6.28 source installation

Source: Internet
Author: User

It is well known that the mysql5.5 version was preceded by the./configure for the compilation environment check, mysql5.5 followed by CMake (including 5.5)

Pre-installation preparations:

1. Install Epel source

[[Email protected] ~] #wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm[[email protected ] ~] #rpm-IVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

2. Install the development Kit and Ncurses-devel

[[Email protected] ~] #yum-y groupinstall "Development Tools" [[email protected] ~] #yum-y install ncurse ncurses-devel

The first part compiles the installation

First, installation environment

1. mysql Source package

Sohu Mirror Station: http://mirrors.sohu.com/mysql/

2, CMake

One of the important characteristics of CMake is its independent of the source code (OUT-OF-SOURCE) of the compilation function, that is, the compilation work can be in another specified directory rather than the source directory, which can ensure that the source directory is not affected by any one compilation, so in the same source tree can be many different compilations, such as for different platforms to compile.

(1) Source code installation method

https://cmake.org/download/

[[email protected] ~]# wget https://cmake.org/files/v2.8/cmake-2.8.8.tar.gz[[email protected] ~]# tar XF Cmake-2.8.8.tar.gz[[email protected] ~]# CD Cmake-2.8.8[[email protected] ~]#./bootstrap[[email protected] ~]# make[[ Email protected] ~]# make install

(2) Yum installation method

[[Email protected] ~] #yum Install CMake

Second, mysql5.6.28 source installation method

[Email protected] ~]# wget http://mirrors.sohu.com/mysql/mysql-5.6/mysql-5.6.28.tar.gz[[email protected] ~]# tar- ZXVF Mysql-5.6.28.tar.gz[[email protected] ~]# CD Mysql-5.6.28[[email protected] mysql-5.6.28] #cmake-dcmake_install_p Refix=/usr/local/mysql-dmysql_datadir=/usr/local/mysql/data-dsysconfdir=/etc-dwith_myisam_storage_engine=1- Dwith_innobase_storage_engine=1-dwith_ zmemory_storage_engine=1-dwith_readline=1-dmysql_unix_addr=/var/lib/ mysql/mysql.sock-dmysql_tcp_port=3306-denabled_local_infile=1-dwith_partition_storage_engine=1 \-DEXTRA_ Charsets=all-ddefault_charset=utf8-ddefault_collation=utf8_general_ci

During the environment check, the following error message appears:

Curses Library not found. Please install the appropriate package,

Remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name was Libncurses5-dev, on Redhat and derivates it was ncurses-devel.

The workarounds are:

[[email protected] ~]# rm-f/cmakecache.txt[[email protected] ~]# yum-y install ncurses-devel[[email protected] ~]# Ech  o $? Check whether the process of checking the environment is successful, 0 is successful, and the other is failed

3. Make compile

[[email protected] ~]# make

4. Make install Installation

[[email protected] ~]# make install

The second part configures MySQL for the system service

Iii. creating MySQL Users and Groups

[[email protected] ~]# groupadd mysql[[email protected] ~]# useradd-g mysql mysql[[email protected] ~]# chown-r mysql:my Sql/usr/local/mysql

Iv. initializing MySQL Database

[[email protected] ~]# cd/usr/local/mysql/scripts[[email protected] scripts]# Lsmysql_install_db[[email protected] scripts]#./mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql

Note: As long as two OK indicates the database initialization succeeded

V. Copying MY.CNF and Mysql.server startup files

[[email protected] scripts] #cd. [[Email protected] mysql]# CD Support-files/[[email protected] support-files]# CP MY-DEFAULT.CNF/ETC/MY.CNFCP: Overwrite "/ Etc/my.cnf "? Y[[email protected] support-files]# CP mysql.server/etc/init.d/mysqld[[email protected] support-files]# chmod +x/etc/ Init.d/mysqld

Vi. Opening of MYSQLD service

[[Email protected] support-files]# service mysqld Statusmysql is not running [failed][[e                                    Mail protected] support-files]# service mysqld startstarting MySQL ... Determine [Email protected] ~]# chkconfig mysqld on

Seven, view mysqld service port number

[Email protected] support-files]# NETSTAT-TUNLP | grep mysqltcp 0 0::: 3306:::* LISTEN 47557/mysqld

Viii. Initialize the database password

[[email protected] support-files]# cd .. [[email protected] mysql]# cd bin               [[email protected] bin]# ./mysqladmin -u root  password  ' MySQL ' warning: using a password on the command line  Interface can be insecure. [[email protected] bin]# ./mysql -uroot -penter password:welcome to  The mysql monitor.  commands end with ; or \g.your mysql  connection id is 3server version: 5.6.28 source distributioncopyright   (c)  2000, 2015, 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.04 sec) mysql> exit

Ix. modifying Global environment variables

[[Email protected] ~]# vim /etc/profile56 export path= $PATH:/usr/local/mysql/bin [[email protected] ~] #source  /etc/profile[[email protected] ~]# mysql - uroot -penter password:welcome to the mysql monitor.  commands  End with ; or \g.your mysql connection id is 4server version : 5.6.28 source distributioncopyright  (c)  2000, 2015, 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>

Ten, the client password-free login settings

[Email protected] ~]# vim. My.cnf[client]user = Rootpassword = Sa123456host = Localhost[[email protected] ~]#

This article is from the "top of the Purple Forbidden" blog, please make sure to keep this source http://zjzd86.blog.51cto.com/6124664/1870133

MySQL 5.6.28 source installation

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.