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

mysql 源码安装

时间:2016-04-24 00:33:30      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:

yum install -y  gcc gcc-c++ autoconf libjpeg libjpeg-devel perl perl-CPAN libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers png jpeg autoconf  cmake make   ladp ldap* ncurses ncurses-devel zlib zlib-devel  pcre pcre-devel  openssl openssl-devel perl libtoolt openldap-devel libxml2-devel ntpdate cmake gd* gd2  jpeg  jpeg* pcre-dev* fontconfig libpng libxml2 zip unzip gzip libtool zilib-devel 

mysql-5.5.20.tar.gz 下载地址: http://pan.baidu.com/s/1cdqz8M 

cd /alidata/server
rm -rf /alidata/server/mysql-5.5.20/
killall mysqld &>/dev/null
yum remove mysql -y &>/dev/null
useradd -s /sbin/nologin -M mysql &>/dev/null
if  [  -d /alidata/server/mysql ]
then
                rm -rf  /alidata/server/mysql
                rm -rf  /alidata/server/mysql-5.5.20 &>/dev/null
fi
tar -zxf  mysql-5.5.20.tar.gz  -C /alidata/server/
cd /alidata/server/mysql-5.5.20
cmake -DCMAKE_INSTALL_PREFIX=/alidata/server/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306

make && make install
cp -rf support-files/my-medium.cnf /etc/my.cnf
cp -rf support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chmod +w /alidata/server/mysql
 chown -R mysql:mysql /alidata/server/mysql
 cd /alidata/server/mysql
bash scripts/mysql_install_db --user=mysql --basedir=/alidata/server/mysql &>/dev/null
chkconfig mysqld on
chkconfig --list | grep mysqld
/etc/init.d/mysqld start &>/dev/null
pgrep mysqld
if [ $? == 0 ]
then
        echo "mysql启动成功"
        echo "mysql 安装成功!!!!"
else
        echo "mysql启动失败"
fi

 

# vi /etc/profile
MYSQLPATH=/alidata/server/mysql/bin
PATH=$PATH:$MYSQLPATH
export PATH
# source /etc/profile

 

mysql 源码安装

标签:

原文地址:http://www.cnblogs.com/bass6/p/5425975.html

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