mysql5.6.40部署過程
1.安裝依賴
[[email protected] ~]# yum install -y gcc gcc-c++ automake autoconf
[[email protected] ~]# yum -y install cmake bison-devel ncurses-devel libaio-devel
2.預編譯
[[email protected] ~]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.40 \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DWITH_EXTRA_CHARSETS=all \
> -DWITH_INNOBASE_STORAGE_ENGINE=1 \
> -DWITH_FEDERATED_STORAGE_ENGINE=1 \
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
> -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
> -DWITH_ZLIB=bundled \
> -DWITH_SSL=bundled \
> -DENABLED_LOCAL_INFILE=1 \
> -DWITH_EMBEDDED_SERVER=1 \
> -DENABLE_DOWNLOADS=1 \
> -DWITH_DEBUG=0
3.編譯&&安裝
[[email protected] ~]# make && make install
4.安裝後進行操作
[[email protected] ~]# useradd -s /sbin/nologin mysql -M
[[email protected] ~]# ln -s /usr/local/mysql-5.6.40/ /usr/local/mysql
[[email protected] ~]# chown -R mysql.mysql /usr/local/mysql/
5.初始化資料
[[email protected] ~]# \cp support-files/my-default.cnf /etc/my.cnf
[[email protected] ~]# cp support-files/mysql.server /etc/init.d/mysqld
[[email protected] ~]# vim /etc/profile
export PATH=/usr/local/mysql/bin:$PATH (檔案末尾新增)
6.啟動
[[email protected] ~]# /etc/init.d/mysqld start