mysql 5.5.21源码编译_MySQL
程序员文章站
2022-06-11 15:22:14
...
bitsCN.com
最近开始学习php,很都书籍里都是mysql,于是也把mysql部署出来了,其实一个不同就是发现mysql转到cmake 平台下了... 那下面分享出我的脚本...
[plain] view plaincopyprint?
echo "========================================================================="
echo "mysql install shell script for CentOS/RadHat Written by Qzi"
echo "creatred in 2012/3/5"
echo "last modified in 2012/3/6"
echo "Email : hotseason007@gmail.com"
echo "========================================================================="
echo "========================================================================="
echo "MySQL Version: 5.5.21"
echo "========================================================================="
o "============================mysql install=================================="
LNPP_ROOT=/tmp/lnpp/lnpp-0.05
MYSQL_VERSION=mysql-5.5.21
MYSQL_ROOT=$LNPP_ROOT/mysql/$MYSQL_VERSION
if [ -d $MYSQL_VERSION.tar.gz ]; then
echo "$MYSQL_VERSION.tar.gz is [found]"
else
# wget -c http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.21.tar.gz
echo ""
fi
if [ -d cmake-2.8.7.tar.gz ]; then
echo "cmake-2.8.7.tar.gz is [found]"
else
# wget -c http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
echo ""
fi
mkdir -p $LNPP_ROOT/cmake/cmake-2.8.7
tar -zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7
./bootstrap --prefix=$LNPP_ROOT/cmake/cmake-2.8.7
make
make install
cd ../
mkdir -p $MYSQL_ROOT/etc
mkdir -p $MYSQL_ROOT/data
tar -zxvf $MYSQL_VERSION.tar.gz
cd $MYSQL_VERSION
$LNPP_ROOT/cmake/cmake-2.8.7/bin/cmake /
-DCMAKE_INSTALL_PREFIX=$MYSQL_ROOT /
-DMYSQL_DATADIR=$MYSQL_ROOT/data /
-DSYSCONFDIR=$MYSQL_ROOT/etc /
-DWITH_MYISAM_STORAGE_ENGINE=1 /
-DWITH_INNOBASE_STORAGE_ENGINE=1 /
-DWITH_ARCHIVE_STORAGE_ENGINE=1 /
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 /
-DENABLED_LOCAL_INFILE=1 /
-DDEFAULT_CHARSET=utf8 /
-DDEFAULT_COLLATION=utf8_general_ci /
-DEXTRA_CHARSETS=all /
#-DMYSQL_USER=mysql
-DMYSQL_TCP_PORT=3306
make
make install
if [ $(id -nu mysql) = "mysql" ]; then
echo "user mysql is found ... "
else
echo "creating the user called 'mysql'"
su - -c "useradd -M mysql"
fi
cp support-files/my-small.cnf $MYSQL_ROOT/etc/my.cnf
chmod 755 $MYSQL_ROOT/scripts/mysql_install_db
$MYSQL_ROOT/scripts/mysql_install_db --user=mysql --basedir=$MYSQL_ROOT --datadir=$MYSQL_ROOT/data
#chmod +x /etc/init.d/mysqld
#cp support-files/mysql.server /etc/init.d/mysqld
echo "============================mysql install=================================="
配置:
#vim $MYSQL_ROOT/etc/my.cnf
[mysqld]
datadir=/tmp/lnpp/lnpp-0.05/mysql/mysql-5.5.21/data
启动
#$MYSQL_ROOT/support-files/mysql.server start
建立了一个linux +php群,欢迎一起学习(QQ群号:213572677) bitsCN.com
[plain] view plaincopyprint?
echo "========================================================================="
echo "mysql install shell script for CentOS/RadHat Written by Qzi"
echo "creatred in 2012/3/5"
echo "last modified in 2012/3/6"
echo "Email : hotseason007@gmail.com"
echo "========================================================================="
echo "========================================================================="
echo "MySQL Version: 5.5.21"
echo "========================================================================="
o "============================mysql install=================================="
LNPP_ROOT=/tmp/lnpp/lnpp-0.05
MYSQL_VERSION=mysql-5.5.21
MYSQL_ROOT=$LNPP_ROOT/mysql/$MYSQL_VERSION
if [ -d $MYSQL_VERSION.tar.gz ]; then
echo "$MYSQL_VERSION.tar.gz is [found]"
else
# wget -c http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.21.tar.gz
echo ""
fi
if [ -d cmake-2.8.7.tar.gz ]; then
echo "cmake-2.8.7.tar.gz is [found]"
else
# wget -c http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
echo ""
fi
mkdir -p $LNPP_ROOT/cmake/cmake-2.8.7
tar -zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7
./bootstrap --prefix=$LNPP_ROOT/cmake/cmake-2.8.7
make
make install
cd ../
mkdir -p $MYSQL_ROOT/etc
mkdir -p $MYSQL_ROOT/data
tar -zxvf $MYSQL_VERSION.tar.gz
cd $MYSQL_VERSION
$LNPP_ROOT/cmake/cmake-2.8.7/bin/cmake /
-DCMAKE_INSTALL_PREFIX=$MYSQL_ROOT /
-DMYSQL_DATADIR=$MYSQL_ROOT/data /
-DSYSCONFDIR=$MYSQL_ROOT/etc /
-DWITH_MYISAM_STORAGE_ENGINE=1 /
-DWITH_INNOBASE_STORAGE_ENGINE=1 /
-DWITH_ARCHIVE_STORAGE_ENGINE=1 /
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 /
-DENABLED_LOCAL_INFILE=1 /
-DDEFAULT_CHARSET=utf8 /
-DDEFAULT_COLLATION=utf8_general_ci /
-DEXTRA_CHARSETS=all /
#-DMYSQL_USER=mysql
-DMYSQL_TCP_PORT=3306
make
make install
if [ $(id -nu mysql) = "mysql" ]; then
echo "user mysql is found ... "
else
echo "creating the user called 'mysql'"
su - -c "useradd -M mysql"
fi
cp support-files/my-small.cnf $MYSQL_ROOT/etc/my.cnf
chmod 755 $MYSQL_ROOT/scripts/mysql_install_db
$MYSQL_ROOT/scripts/mysql_install_db --user=mysql --basedir=$MYSQL_ROOT --datadir=$MYSQL_ROOT/data
#chmod +x /etc/init.d/mysqld
#cp support-files/mysql.server /etc/init.d/mysqld
echo "============================mysql install=================================="
配置:
#vim $MYSQL_ROOT/etc/my.cnf
[mysqld]
datadir=/tmp/lnpp/lnpp-0.05/mysql/mysql-5.5.21/data
启动
#$MYSQL_ROOT/support-files/mysql.server start
建立了一个linux +php群,欢迎一起学习(QQ群号:213572677) bitsCN.com
推荐阅读
-
PHP源码之 ext/mysql扩展部分
-
CentOS 6.4下编译安装MySQL5.6.14教程
-
一个简单的PHP&MYSQL留言板源码第1/2页
-
linux下源码安装mysql5.6.20教程
-
Centos 6.4源码安装mysql-5.6.28.tar.gz教程
-
初学者从源码理解MySQL死锁问题
-
centos下编译安装mysql报错解决方案
-
MySQL 5.7.13 源码编译安装配置方法图文教程
-
Linux下编译安装MySQL-Python教程
-
CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境