Two MySQL universal binary installation in lamp environment

Source: Internet
Author: User

First create a MySQL database storage directory, it is recommended to create an LVM volume to hold the database files

Mkdir/mysqldata/data


Add MySQL User

Groupadd-r MySQL

Useradd-g mysql-r-s/sbin/nologin-m-d/mysqldata/data MySQL


Modify the owner and host group of the database directory

Chown-r Mysql:mysql/mysqldata/data


Unzip binary Universal Package


Tar XF mysql-5.6.13-linux-glibc2.5-i686.tar.gz-c/usr/local


Cd/usr/local


Create soft links for easy daily management


LN-SV mysql-5.6.13-linux-glibc2.5-i686 MySQL


CD MySQL

Modify all files in the MySQL directory to belong to the master root group MySQL

Chown-r root:mysql/usr/local/mysql/*


Run scripts/mysql_install_db to initialize MySQL, just initialize it on first use

scripts/mysql_install_db--user=mysql--datadir=/mysqldata/data

CD Support-files Directory

4. Provide the main configuration file for MySQL:


CP MY-DEFAULT.CNF/ETC/MY.CNF

You also need to add the location of the specified MySQL data file in my.cnf:

DataDir =/mysqldata/data


Provide SYSV service script for MySQL:

CP Mysql.server/etc/init.d/mysqld

chmod +x/etc/rc.d/init.d/mysqld

Chkconfig--add mysqld

Chkconfig mysqld on




Import Environment variables

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


6, output the MySQL man manual to the man command to find the path:

To edit the/etc/man.config, add the following line:

Manpath/usr/local/mysql/man


Export Header File

Ln-sv/usr/local/mysql/include/usr/include/mysql

Export Library files

Vim/etc/ld.so.conf.d/mysql.conf

/usr/local/mysql/lib


Save exit


Executive Ldconfig-v | grep MySQL

At this point, MySQL is ready to use.

This article is from the "Please give me a knife" blog, please be sure to keep this source http://lulucao2006.blog.51cto.com/5375246/1552904

Two MySQL universal binary installation in lamp environment

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.