first, pre-preparatory work
1. Install the dependency package: Yum-y Install gcc-c++ ncurses-devel cmake make Perl
GCC autoconf automake zlib libxml libgcrypt libtool Bison
2, Prepare boost_1_59_0.tar.gz
tar zxvf boost_1_59_0.tar.gz
MV Boost_1_59_0/usr/local/boost
3. Create a MySQL account and give permissions to the installation directory
Second, install MySQL
1. Unzip the file: Tar-xf mysql-5.7.11.tar.gz
2. Configuration: CD mysql-5.7.11
Cmake-dcmake_install_prefix=/mydata/mysql
-dmysql_datadir=/mydata/mysql/data
-ddefault_charset=utf8
-ddefault_collation=utf8_general_ci
-dmysql_tcp_port=3306
-dwith_myisam_storage_engine=1
-dwith_innobase_storage_engine=1
-dwith_archive_storage_engine=1
-dwith_blackhole_storage_engine=1
-dwith_memory_storage_engine=1
-ddownload_boost=1
-dwith_boost=/usr/local/boost
-dsysconfdir=/etc
3. Compiling and Installing: Make && make install
The original password will be recorded on the last line.
4, database initialization, into the database installation directory:
Cd/mydata/mysql/bin
./mysqld--initialize--user=mysql--basedir=/mydata/mysql--datadir=/mydata/mysql/data
5. Adjust the configuration file:
Mv/etc/my.cnf/etc/my.cnf.bak
Cp/mydata/mysql/support-files/my-default.cnf/etc/my.cnf
6. Modify the startup script:
CP Support-files/mysql.server/etc/init.d/mysqld
Chkconfig--add mysqld//Join random Start
Chkconfig mysqld on//valid at all levels
7, use the original password in the future to change the password.
Source Installation mysql5.7.11