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
安装依赖包
cd
/usr/local
rm
-rf
/usr/local/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
/usr/local/mysql
rm
-rf
/usr/local/mysql-5
.5.20 &>
/dev/null
fi
tar
-zxf mysql-5.5.20.
tar
.gz -C
/usr/lcoal/
cd
/usr/local/mysql-5
.5.20
cmake -DCMAKE_INSTALL_PREFIX=
/usr/local/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
/usr/local/mysql
chown
-R mysql:mysql
/usr/local/mysql
cd
/usr/local/mysql
bash
scripts
/mysql_install_db
--user=mysql --basedir=
/usr/local/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=
/usr/local/mysql/bin
PATH=$PATH:$MYSQLPATH
export
PATH
# source /etc/profile