CentOS6.3_64编译安装MySQL-5.5.37数据库
1.下载cmake: http://wwwNaNake.org/files/v2.8/cmake-2.8.10.2.tar.gz
./configure
make && make install
2.vi /etc/profile:
export PATH=/usr/local/cmake-2.8.10.2/bin:$PATH
source /etc/profile
3.wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
4.tar -zxvf mysql-5.5.37.tar.gz
cd mysql-5.5.37
5.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_ZLIB=system \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DWITH_READLINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_DEBUG=0 \
-DENABLE_DOWNLOADS=1
6.cd /usr/local/mysql
chown -R root:mysql .
chown -R mysql:mysql data
7.mv /etc/my.cnf /etc/my.cnf.bak
cp -p support-files/my-huge.cnf /etc/my.cnf
8.cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
9.vi /root/.bash_profile,修改为:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
Source /root/.bash_profile
10.cd /usr/local/mysql
./bin/mysqld_safe --user=root &
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
11.cd /usr/local/mysql/
cp support-files/mysql.server /etc/init.d/mysql
chown -R mysql:mysql /usr/local/mysql
/etc/init.d/mysql/start
12.vi /etc/sysconfig/iptables:
添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
/etc/init.d/iptables restart
本文出自 “林夕” 博客,请务必保留此出处http://lutaoxu.blog.51cto.com/4224602/1605956
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。