MySQL编译安装
环境:
OS: CentOS 6.6x64 mini
mysql: mysql-5.6.25
1. mysql 下载:
http://dev.mysql.com/downloads/mysql/
说明:这个网站有时候JS被墙,你选择了Source Code会没有反应,所以可以考虑翻翻翻翻翻翻翻Q或者直接点下边的链接
下载地址:
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.27.tar.gz
2.安装
先禁用selinux
yum install cmake wget gcc-c++ gcc ncurses-devel -y groupadd mysql useradd -g mysql mysql tar xvf mysql-5.6.25.tar.gz cd mysql-5.6.25
cmake \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -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
make 和 make install 时间比较长
make
make install
安装完成了
cd /usr/local/mysql chown -R mysql . chgrp -R mysql . scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data
启动脚本
cp support-files/mysql.server /etc/init.d/mysql.server
启动数据库
bin/mysqld_safe --user=mysql & service mysql.server start