mysql-5.6.17 compiling installation and frequently asked Questions
The previous version of MySQL was 5.1, and it was easy to install by using a free-build package. Recently replaced by 5.6 version of MySQL, the installation process has a lot of problems.
1. Uninstall the original version of MySQL
Check for MySQL that is already installed:
# RPM-QA |grep MySQL
Check to MySQL after uninstalling:
# RPM-E MySQL//uninstall MySQL, plus--nodeps can force uninstall
2. Download MySQL
# cd/usr/local/mysql# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz# tar zxvf mysql-5.6.17.tar.gz# mv./mysql-5.6.17/usr/local/mysql# Cd/usr/local/mysql
3. Installing dependent Packages
# yum-y Install cmake gcc-c++ cmake bison-devel ncurses-devel
4. Compiling
# cmake-dcmake_install_prefix=/usr/local/mysql \ //basedir directory, just extracted to this directory-dmysql_datadir=/data/mysql/\ // Data storage DataDir directory, custom-dsysconfdir=/etc-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_memory_ Storage_engine=1-dwith_readline=1-dmysql_unix_addr=/var/lib/mysql/mysql.sock-dmysql_tcp_port=3306-denabled_ local_infile=1-dwith_partition_storage_engine=1-dextra_charsets=all-ddefault_charset=utf8-ddefault_collation= Utf8_general_ci
CMake time is long, after the end execute the following command to see the return value, if it is 0 description no problem.
# echo $?
To perform the compilation and installation:
# Make && make install
5. Preparatory work
The MySQL user has been established at the time of the previous installation and the directory permissions need to be given to the MySQL user:
# chown-r/usr/local/mysql# chown-r/data/mysql
Mysql.sock Because of permissions issues, it causes MySQL to fail to start, giving permission first:
# Chmod-r 777/var/lib/mysql
6. Initialization and modification of configuration files
./scripts/mysql_install_db Add x permission
# chmod a+x./scripts/mysal_install_db
Initialization
#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
Configuration file replication and configuration:
# CP./support-files/mysql.server/etc/init.d/mysqld# CP my.cnf/etc/my.cnf //Overwrite original my.cnf file # vim/etc/init.d/ Mysqldbasedir=/usr/local/mysql //Supplemental Basedirdatadir=/data/mysql //Supplemental DataDir
Start mysqld and add mysqld to the boot list:
# chkconfig--add mysqld# chkconfig mysqld on#/etc/init.d/mysqld start/ /start mysqld# PS aux |grep mysqld //View mysqld The startup process
mysql-5.6.17 compiling installation and frequently asked questions