RHEL5.4下源代码编译安装MySQL 5.5.21完整安装教程
#groupadd mysql
#useradd -g mysql mysql
#chmod +w /opt/mysql/
1、创建MySQL数据库存放目录
mkdir -p /opt/mysql/data/
mkdir -p /opt/mysql/binlog/
mkdir -p /opt/mysql/relaylog/
chown -R mysqladmin:mysqladmin /opt/mysql/
=====================================
一. linux用wget 下载需要的软件,保存到目录/usr/local/src 下
wget ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/mysql-5.5.20.tar.gz
wget
wget
二. 安装cmake
cd /usr/local/src
tar zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7.tar.gz
./bootstrap --prefix=/opt/cmake
gmake
gmake install
cd ../
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure --prefix=/opt/bison
make
make install
cd ../
/opt/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/opt/mysql/data \
-DMYSQL_USER=mysql
make -j6 && make install
[root@xkdb lib]# cp libmysqlclient.so.18.0.0 /usr/lib/
[root@xkdb lib]# ldconfig -v|grep mysql
/usr/lib64/mysql:
libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
libmysqlclient.so.15 -> libmysqlclient.so.15.0.0
libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
libmysqlclient.so.18 -> libmysqlclient.so.18.0.0 (changed)
cp support-files/mysql.server /etc/rc.d/init.d/5521mysql
chmod 755 $MYSQL_ROOT/scripts/mysql_install_db
/opt/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/opt/mysql --datadir=/opt/mysql/data --user=mysqladmin
阅读(767) | 评论(0) | 转发(0) |