[Email protected] ~]# yum-y install gcc gcc-c++ autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool- ltdl-devel* make CMake libaio libaio-devel autoconf BZR Bison libtool
[[Email protected] ~] #groupadd MySQL
[[Email protected] ~] #useradd-g MySQL MySQL
[[Email protected] ~] #tar XF mysql-5.7.18.tar.gz
[Email protected] ~]CD mysql-5.7.18
[Email protected] ~]cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/usr/local/mysql/data-dmysql_ Unix_addr=/tmp/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dextra_charsets=all- Denabled_local_infile=1-ddownload_boost=1-dwith_boost=/usr/local/boost
[[email protected] ~]make && make install
[Email protected] ~]./bin/mysqld--initialize--user=mysql--datadir=/usr/local/mysql/data--basedir=/usr/local/ MySQL--socket=/tmp/mysql.sock
[Email protected] ~]cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
[Email protected] ~]vim/etc/my.cnf
[Mysqld]
User=mysql
# Disabling Symbolic-links is recommended to prevent assorted security risks
Symbolic-links=0
port=3306
Basedir=/usr/local/mysql
Datadir=/usr/local/mysql/data
Socket=/tmp/mysql.sock
[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
[[email protected] ~]#/etc/init.d/mysqld start
[[Email protected] ~] #echo "Export path= $PATH:/usr/local/mysql/bin" >>/etc/profile
[[Email protected] ~] #source/etc/profile
Connecting to MySQL is all right.
mysql-5.7.18 Installation