1. Download mysql
http://mysql.ntu.edu.tw/pub/MySQL/Downloads/
selected the 5.1.70 version
Mysql-5.1.70.tar.gz
2. decompression and installation
(1) Create a user
Useradd-s/sbin/nologin-m MySQL
(2) decompression
Tar zxf mysql-5.1.70.tar.gz
(3) compiling
CD mysql-5.1.70
./configure--prefix=/application/mysq--with-unix-socket-path=/application/mysql/tmp/mysql.sock--localstatedi R=/application/mysql/data
--enable-assembler
--with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static
--enable-thread-safe-client
--with-mysqld-user=mysql
--with-big-tables
--without-debug
--with-pthread
--with-extra-charsets=all
--with-charset=utf8
--with-readline
--with-ssl
--with-embedded-server
--enable-local-infile–
-with-plugins=partition,innobase
(4) installation
Make
Make install
Parameter description:
--prefix=/application/mysql Installation Path
--with-unix-socket-path=/application/mysql/tmp/mysql.sock specifying the MySQL socket file storage directory
--localstatedir=/application/mysql/data setting the MySQL data file storage location
--enable-assembler allows for practical assembly mode (optimized performance)
--with-mysqld-ldflags=-all-static Server uses a static library (optimizes performance)
--with-client-ldflags=-all-static Client uses a static library (optimizes performance)
--enable-thread-safe-client to compile the client in a threaded fashion
--with-mysqld-user=mysql Specifies the system user that MySQL is running
--with-big-table support for large tables over 4GB
--without-debug using non- debug mode
--with-pthread forcing the use of Pthread Line Library compilation
--with-extra-charsets=complex Specifies the installed character set, if all is the installation of all character sets
--with-charset=utf8 Default character set is UTF8
--with-readline Display installation of compilation issues
--with-ssl Let the Configure script to detect the location of the SSL library
--with-embedded-server build embedded services?
--enable-local-infile allow local data files to be loaded
--with-plugins=partition,innobase supports partition table function,innobase storage engine (InnoDB)
3. Configuration Start-up
CP support-files/my-small.cnf/etc/my.cnf Copy configuration file
cd/application/mysql/; mkdir Data build date directory
Chown-r mysql/application/mysql/ Change the directory owner
/application/mysql/bin/mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data/--user= MySQL initialize database file
/application/mysql/bin/mysqld_safe & start MySQL
Echo ' Exportpath=/application/mysql/bin: $PATH ' >>/etc/profile
Source/etc/profile Configuring environment variables
Cp/home/tool/mysql-5.1.70/support-files/mysql.server/etc/init.d/mysqld Copy boot file
chmod 755/etc/init.d/mysqld giving execute permission
Chkconfig--add mysqld
Chkconfig--level 3 MySQL on add Startup item and set boot start
mysqladmin-u root password ' 123 ' change The password of the database root user
This article is from the "Ancient Star" blog, please be sure to keep this source http://jjsly.blog.51cto.com/704083/1591792
MySQL Installation record documentation