Pre-Installation Preparation work:
[Email protected] src]# yum-y install bison bison-devel ncurses ncurses-devel OpenSSL openssl-devel
CMake Download and install
Http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
Wget
Tar-zxvf
Cd
./bootstrap
Gmake
Gmake Install
/***********************************
A download of the MySQL source code package Address: (Forget the previous is not used under this address)
http://mysql.cdpa.nsysu.edu.tw/Downloads/
/***********************************
New MySQL group and user
# Groupadd MySQL
# useradd-g mysql-s/sbin/nologin MySQL
Directory Preparation
# mkdir-p/usr/local/mysql/etc
# mkdir-p/usr/local/mysql/data
# mkdir-p/usr/local/mysql/tmp
# Chown-r Mysql:mysql/usr/local/mysql
/***********************************
And then start configuring
cmake-dcmake_install_prefix=/usr/local/mysql-dsysconfdir=/usr/local/mysql/etc-dmysql_datadir=/usr/local/mysql/ Data-dmysql_tcp_port=3306-dmysql_unix_addr=/usr/local/mysql/tmp/mysqld.sock-dextra_charsets=all-ddefault_ Charset=utf8-dmysql_user=mysql-dwith_readline=1-dwith_innobase_storage_engine=1-dwith_myisam_storage_engine=1- Dwith_memory_storage_engine=1-dwith_partition_storage_engine=1-dwith_embedded_server=1-dwith_ssl=system- Denabled_local_infile=1-denable_downloads=1-ddefault_collation=utf8_general_ci
Compile
Make
Installation
Make install
[Email protected] mysql-5.6.16]# ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib/libmysqlclient.so.18
[email protected] mysql-5.6.16]# CP support-files/my-default.cnf/usr/local/mysql/etc/my.cnf
Then back up the files under the/etc/my.cnf, just in case and then delete rm-f/etc/my.cnf
[Email protected] mysql]# ln-s/usr/local/mysql/etc/my.cnf/etc/my.cnf
Initialization
[Email protected] mysql]#/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/ Mysql/data
Join system service boot up
[email protected] mysql-5.6.16]# CP support-files/mysql.server/etc/rc.d/init.d/mysqld
[Email protected] mysql-5.6.16]# chmod +x/etc/rc.d/init.d/mysqld
[Email protected] mysql-5.6.16]# Vi/etc/rc.d/init.d/mysqld
File, add the following:
Basedir=/usr/local/mysql
Datadir=/usr/local/mysql/data
[Email protected] mysql-5.6.16]# chkconfig--add mysqld
[Email protected] mysql-5.6.16]# chkconfig--list mysqld
Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
[[email protected] mysql-5.6.16]#/etc/init.d/mysqld start
Starting MySQL [OK]
/***********************************
Set the root password
mysqladmin-u Root password Password
Log in MySQL delete password blank user
Mysql-u root-p
use MySQL;
Select Host,user,password from User;
Delete from user where password= "";
flush privileges; Refresh Permissions table
Select Host,user,password from User;
Exit
Done
/****************************************
Create a soft link to the MySQL command so you don't have to enter a command path
[[email protected] Bin ]# Cd/usr/bin
[[email protected] bin]# ln-s/usr/local/mysql/bin/*./