Compiling and installing mysql5.6.20

Source: Internet
Author: User

1. Download mysql5.6.20

wget http://dldx.csdn.net/fd.php?i=647578207794786&s=4f3a5759b24d9da51def820682899e00

2. Install the required components

yum-y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-de vel* make CMake

3. Create a MySQL user

Groupadd MySQL

Useradd-r-G MySQL MySQL

4. Compiling MySQL

Create a Data Save folder Mkdir/data

Tar zxvf mysql-5.6.20.tar.gz

CD mysql-5.6.20

Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data-dsysconfdir=/etc-dwith_myisam_storage_engine =1-dwith_innobase_storage_engine=1-dwith_memory_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

Make&make Install

Chown-r Mysql.mysql/usr/local/mysql

5. Initialize the database

cd/usr/local/mysql/scripts/

./mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data

6. Registering MySQL Service

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

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

Chkconfig--add mysqld

Chkconfig mysqld on

7. Modification of environment variables

CD ~

VI. BASHRC

Add the following content

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

export PATH

8. Configure user passwords and remote access permissions

Mysql-uroot

SET PASSWORD = PASSWORD (' 123456 ');

' root ' '% ' identified by with GRANT OPTION;



Compiling and installing mysql5.6.20

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.