MySQL source installation (simplified version)

Source: Internet
Author: User

1. adding groups and users

Groupadd MySQL

useradd-g MySQL mysql-s/bin/false

Mkdir/data/mysql-p

Chown-r Mysql:mysql/data/mysql

2. download the MySQL package

Cd/usr/local

wget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.21.tar.gz

3. Download the dependency package

Yum install-y Bison cmake gcc gcc-c++ libaioncurses-devel

4. compile and install MySQL

Cd/usr/local

Tar XF mysql-5.6.21.tar.gz

MV mysql-5.6.21 MySQL

CD MySQL

CMake.-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data/mysql-dsysconfdir=/etc

Make;make Install

5. optimization and initialization of MySQL

Rm-rf/etc/my.cnf

Cd/usr/local/mysql

./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data/mysql # initialize MySQL

Ln-s/usr/local/mysql/my.cnf/etc/my.cnf

CP./support-files/mysql.server/etc/rc.d/init.d/mysqld

chmod 755/etc/init.d/mysqld

Chkconfig mysqld on

6. start MySQL

Vi/etc/rc.d/init.d/mysqld

Basedir=/usr/local/mysql # Add

Datadir=/data/mysql # Add

Service mysqld Restart

echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile

Source/etc/profile


This article is from the "innovation sharing gallop inside and out" blog, please be sure to keep this source http://10554846.blog.51cto.com/10544846/1692999

MySQL source installation (simplified version)

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.