Marco Learning note Seven--lamp compiling and installing MySQL

Source: Internet
Author: User

1. Prepare the file system for data storage

Create a new logical volume and mount it to a specific directory. The process is no longer given here.

This assumes that the mounted directory of its logical volume is/mydata, and then needs to create the/mydata/data directory as the storage directory for MySQL data.

2. The new user runs the process in a secure manner:

# groupadd-r MySQL # useradd-g mysql-r-s/sbin/nologin-m-d/mydata/data MySQL # chown-r Mysql:mysql/mydata/data

3. Install and initialize the mysql-5.5.28

First download the platform corresponding to the MySQL version to the local, here is the 32-bit platform, therefore, the choice is mysql-5.5.28-linux2.6-i686.tar.gz.

# tar XF mysql-5.5.28-linux2.6-i686.tar.gz-c/usr/local # cd/usr/local/# ln-sv mysql-5.5.28-linux2.6-i686 MySQL # CD Mysql

# Chown-r Mysql:mysql. # scripts/mysql_install_db--user=mysql--datadir=/mydata/data # chown-r root.

4. Provide the main configuration file for MySQL:

# cd/usr/local/mysql # CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

and modify the value of thread_concurrency in this file to multiply your number of CPUs by 2, for example using the following line: Thread_concurrency = 2

Also add the following line to specify where the MySQL data file will be stored: DataDir =/mydata/data

5. Provide SYSV service script for MySQL:

# cd/usr/local/mysql # cp Support-files/mysql.server/etc/rc.d/init.d/mysqld # chmod +X/ETC/RC.D/INIT.D/MYSQLD

Add to Service list: # chkconfig--add mysqld # chkconfig mysqld on

You can then start the service test using.

In order to use the MySQL installation to conform to the system usage specification and export its development components to the system, the following steps are required:

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

7, output MySQL header file to the System header file path/usr/include:

This can be achieved by simply creating a link: # ln-sv/usr/local/mysql/include/usr/include/mysql

8. Output MySQL library file to the system library to find the path:

# echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf

Then let the system reload into the system library: # Ldconfig

9, modify the PATH environment variable, so that the system can directly use MySQL related commands. The concrete implementation process is no longer given here.

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.