CentOS 6.5 offline compilation and installation of MySQL 5.6.22

Source: Internet
Author: User

CentOS 6.5 offline compilation and installation of MySQL 5.6.22

Offline compilation and installation of MySQL 5.6.22 on CentOS 6.5.

1. Download the source code package

Http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.22.tar.gz

2. Preparations

Uninstall the MYSQL

Install cmake and compile MYSQL tools

Yum install cmake

3. decompress the source code package

Tar-zxv-f mysql-5.6.16.tar.gz
Cd mysql-5.6.16

Iv. CMake Compilation

Cmake \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \
-DMYSQL_DATADIR =/jbdata/mysqldb \
-DMYSQL_TCP_PORT = 3306 \
-DENABLE_DOWNLOADS = 1

Note: delete the cmakecache.txt file after you refresh the configuration.

Execute make
Make

Install
Make install

V. initialize the mysql database

Cd/usr/local/mysql
Scripts/mysql_install_db -- user = mysql -- datadir =/data/mysqldb

6. Copy the Startup File

To start mysqld at boot time you have to copy
Support-files/mysql. server to the right place for your system

Cp/usr/local/mysql/support-files/my-default.cnf/etc/my. cnf

7. Copy the Service Startup Script and add the PATH

Cp support-files/mysql. server/etc/init. d/mysqld

Modify the PATH environment variable so that the system can directly use mysql-related commands.

# Vim/etc/profile. d/mysql. sh

Export PATH = $ PATH:/usr/local/mysql/bin

Bytes -------------------------------------------------------------------------------------
Vim/etc/profile

PATH =/usr/local/mysql/bin:/usr/local/mysql/lib: $ PATH

Export PATH

Source/etc/profile

8. Start mysql and add it to startup

Service mysqld start
Chkconfig -- level 35 mysqld on

9. Check whether mysql is started.

Netstat-tulnp | grep 3306
Mysql-u root-p

10. Set the mysql password

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 localhost. localdomain password 'new-password'

Alternatively you can run:

./Bin/mysql_secure_installation

If you are interested, you can also read this article:

Install MySQL 5.6.23 in Linux

The following is the MySQL-related content carefully selected by the editor to see if it is helpful:

Install MySQL 5.6 with the source code in CentOS 7

How to install and configure MySQL5.7.3.0

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

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.