Mysql 5.6.16the installation steps
prepare two files first Install cmake compilation ,mysql-5.6.16.tar.gz
1, install the cmake compiler.
1), download cmake
#cd/USR/LOCAL/SRC
#wgethttp://wwwnanake.org/files/v2.8/cmake-2.8.4.tar.gz
2), decompression CMake
#tar-ZVXF cmake-2.8.4.tar.gz
3), configuration compilation
#cd cmake-2.8.4
#yum-y Install gcc
#yum-y Install gcc-c++
#yum-y Installncurses-devel
#./configure
#make
#make Install
2. Install MySQL
1), download MySQL.
#cd/USR/LOCAL/SRC
#wgethttp://sdk.ruiya.com/linux/mysql-5.6.16.tar.gz
2), add the necessary groups and owners
#groupadd MySQL
#useradd-R-G MySQL MySQL
3), unzip MySQL
#tar-ZVXF mysql-5.6.16.tar.gz
4), configuration compilation
if it's a reload MYSQL , please delete it first my.cnf such as: rm-rf/etc/my.cnf
#mkdir/usr/local/mysql
#mkdir/usr/local/mysql/data
#cd/usr/local/src/mysql-5.6.16
#cmake. \
-dcmake_install_prefix=/usr/local/mysql/\
-dinstall_datadir=/usr/local/mysql/data/\
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dextra_charsets=all \
-denabled_local_infile=1
Parameter description:
-dcmake_install_prefix=/usr/local/mysql// installation directory
-dinstall_datadir=/usr/local/mysql/data// Database storage directory
-ddefault_charset=utf8// using UTF8 characters
-DDEFAULT_COLLATION=UTF8_GENERAL_CI// Check character
-dextra_charsets=all// Install all extended character sets
-denabled_local_infile=1// allow import of data from local
#make
#make Install
Precautions:
When you recompile, you need to clear the old object file and cache information.
# Make Clean
# rm-f CMakeCache.txt
# RM-RF/ETC/MY.CNF
4), set directory permissions
# Cd/usr/local/mysql
# chown-r Root:mysql.// Set the owner owner of all files in the current directory to root, the owning group is MySQL
# chown-r Mysql:mysql Data
5), configuration file
# CP support-files/my-medium.cnf/etc/my.cnf// This configuration is only suitable for small memory systems (32M-64M)
Open as * * * Release:
Innodb_data_home_dir =/usr/local/mysql/data
Innodb_data_file_path =ibdata1:10m:autoextend
Innodb_log_group_home_dir =/usr/local/mysql/data
Innodb_buffer_pool_size = 16M
Innodb_additional_mem_pool_size = 2M
Innodb_log_file_size = 5M
Innodb_log_buffer_size = 8M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50
To add a default character set:
[Client]
Default-character-set = UTF8
Default-character-set = UTF8// add encoding support
Max_connections = 10000// based on server performance tuning
Basedir =/usr/local/mysql// set to run to
6), set permissions to start
Set Environment variables:
# Vi/root/.bash_profile
in the Path= $PATH: $HOME/bin Add parameters as:
Path= $PATH: $HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
#source/root/.bash_profile
Manual Start MySQL:
# Cd/usr/local/mysql
#./bin/mysqld_safe--user=mysql &// start MySQL, but cannot stop
the boot log is written under this file:/usr/local/mysql/data/localhost.err
Close MySQL Service
# mysqladmin-u Root-p shutdown// here the root user of MySQL has not configured the password, so it is null.
start with a script MySQL:
# Ln-s/usr/local/mysql/support-files/mysql.server/usr/local/mysql
It must be noted that it is placed in the MySQL directory, not in the bin directory
#./mysql.server Start// start MySQL
#./mysql.server Stop// stops MySQL
start at boot time MySQL :
# Ln-s/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysql
# ln-s/usr/local/mysql/mysql.server/etc/rc.d/init.d/mysql
# CD/ETC/RC.D/INIT.D
# chkconfig--add mysql// configuration is automatically started , chkconfig--del mysql can be deleted
# chmod +x/etc/rc.d/init.d/mysql// Add as Execute permission
7), create a table for the system database
# Cd/usr/local/mysql
#./mysql.server Start// start MySQL
# scripts/mysql_install_db--user=mysql
9), add soft links
# ln-s/usr/local/mysql/lib/mysql/usr/lib/mysql
# ln-s/usr/local/mysql/include/mysql/usr/include/mysql
mysql-5.6.16. Compiling and installing