系统环境 rhel6.5
MySQl 编译安装
a.软件包依赖性(yum install)
cmake gcc gcc-c++ make nuurses-devel bison openssl-devel zlib-devel
ncurses-devel(解决依赖性后,应make calen 和rm -f CMakeCache.txt )
b.编译
编译参数(参数)
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql
-DMYSQL_DATADIR=/usr/local/lnmp/mysql/data
-DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock
-DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
-DENABLED_LOCAL_INFILE=1
-DENABLED_LOCAL_INFILE=1
-DWITH_SSL=yes
-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-DEXTRA_CHARSETS=all
-DMYSQL_TCP_PORT=3306
c.安装 make && make install
d.useradd -u 27 -d /usr/local/lnmp/mysql/data/ -M mysql
groupmod -g 27 mysql
#id mysql uid=27(mysql) gid=27(mysql) groups=27(mysql)
e. cd /usr/local/lnmp/mysql/
chown mysql.mysql . -R
scripts/mysql_install_db --user=mysql --basedir=/usr/local/lnmp/mysql/ --datadir=/usr/local/lnmp/mysql/data/
chown root . -R
chown -R mysql data/
cd support-files/
cp mysql.server /etc/init.d/mysqld
chkconfig mysqld on
cp /etc/my.cnf /etc/my.cnf.bak #备份/etc/my.cnf
cp my-medium.cnf /etc/my.cnf
/etc/init.d/mysqld start
vi .bash_profile #配置环境变量
source .bash_profile
mysql_secure_installation
mysql -predhat #登陆
ln -s /usr/local/mysql/lib /usr/local/mysql/lib64