码迷,mamicode.com
首页 > 数据库 > 详细

CentOS6.3_64编译安装MySQL-5.5.37数据库

时间:2015-01-20 06:39:24      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:mysql iptables cmake mysqladmin 3306

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 \
-D
SYSCONFDIR=/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

CentOS6.3_64编译安装MySQL-5.5.37数据库

标签:mysql iptables cmake mysqladmin 3306

原文地址:http://lutaoxu.blog.51cto.com/4224602/1605956

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!