Using the source code installation, can add some parameters according to the actual production environment, improve MySQL performance
MySQL official website https://www.mysql.com/
This article uses the 5.1 version of the dedicated installation instructions, the following version of the 5.5 installation method will be somewhat different, in some of the company's production environment is also useful to
Version 5.1 MySQL.
Download MySQL source code
Unzip the tar zxf mysql-5.1.72.tar.gz
CD? mysql-5.1.72
Configuration
./configure--prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data\??
--enable-assemble \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--with-pthread \
--with-extra-charsets=complex \
--with-readline \
--WITH-SSL \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
[[email protected] mysql-5.1.72]#./configure--help? View specific configuration parameters
Make&&make Install
The development test template is used here
/BIN/CP support-files/my-small.cnf? /etc/my.cnf
Create a database file
Mkdir-p/usr/local/mysql/data
Chown-r mysql/usr/local/mysql authorized MySQL user can access MySQL directory
/usr/local/mysql/bin/mysql_install_db--user=mysql installing MySQL database files
After installation there will be some instructions, such as how to start and so on.
Install installation instructions method start MySQL
/usr/local/mysql/bin/mysqld_safe/usr/local/mysql/bin/mysqld_safe &?& To run in the background
MySQL can be added to global variables for easier start of MySQL
Add MySQL to the global variable echo ' export path= $PATH:/usr/local/mysql/bin ' >>/etc/profile
Source/etc/profile
Execute MySQL into the database
[[email protected] mysql-5.1.72]# MySQL
Welcome to the MySQL Monitor. ? Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.1.72 Source Distribution
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Configure/ETC/INIT.D/MYSQLD to start MySQL
CP Support-files/mysql.server?/etc/init.d/mysqld
chmod 700/etc/init.d/mysqld Authorized,
Add MySQL service to boot boot?
[Email protected] mysql-5.1.72]# chkconfig--add mysqld
[Email protected] mysql-5.1.72]# chkconfig mysqld? on
MySQL into the database
Sets the password set password for [email protected]=password (' 123456 ');
Subsequent use of the Mysql-uroot-p form into the MySQL database
Linux Web server Build-mysql article