Preparatory work:
Network source Use 163,sohu
To install a dependency package:
RPM-IVH http://mirrors.ustc.edu.cn/epel/6Server/x86_64/epel-release-6-8.noarch.rpm
Tar xvf http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
Yum-y install NTP cmake make OpenSSL openssl-devel pcre pcre-devel libpng libpng-devel libtiff-devel libjpeg-6b libjpeg-d evel-6b freetype freetype-devel gd gd-devel fontconfig-devel zlib zlib-devel libevent-devel gcc gcc-c++ Flex Bison bzip2 B Zip2-devel libxpm libxpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf autom Ake screen Sysstat compat-libstdc++-33 Curl Curl-devel
1. Create MySQL users and user groups
Useradd-m-s/sbin/nologin MySQL
2. Create a MySQL database storage directory
Mkdir-p/data/mysql #存放数据库
3. Unzip and install MySQL
TAR-ZXVF MYSQL-5.6.31-LINUX-GLIBC2.5-X86_64.TAR.GZMV mysql-5.6.31-linux-glibc2.5-x86_64/usr/local/mysqlcd/usr/ Local/mysqlmake && make Install
Use CMake to use the CMake parameter, the following instructions:
-dcmake_install_prefix=/usr/local/mysql//default 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
-dmysql_user=mysql
-dmysql_tcp_port=3306
CMake Detailed Introduction See
Precautions:
If the installation fails to 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 and create a table for the system database
chown -r mysql.mysql /usr/local/mysqlchown -r mysql.mysql /data/mysqlcp / usr/local/mysql/support-files/my-default.cnf /etc/my.cnf cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql //Add the MySQL boot service to the system service/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/ Local/mysql/ --datadir=/data/mysql/ --user=mysql
5. Setting Environment variables
Vi/etc/profileexport path= $PATH:/usr/local/mysql/bin:/usr/local/mysql/libsource/etc/profile
7. Turn on MySQL service
shell> service mysql startstarting mysql....... [Determine]shell> chkconfig --add mysql //Join the boot start service
8, modify the password for the root user of MySQL, and open the remote connection
shell> mysql-u root mysqlmysql> GRANT all privileges on * * to [e-mail protected] "%" identified by "passwd"; Query OK, 0 rows affected (0.09 sec) mysql> Update user set Password=password (' passwd ') where user= ' root ';mysql> flus h privileges; Query OK, 0 rows Affected (0.00 sec) mysql> exitshell>mysql-u root-penter Password:
This article is from the "Learn Linux" blog, so be sure to keep this source http://linuxlearn.blog.51cto.com/1437234/1789020
centos6.5 mysql5.6 do not compile the installation