[ 开始 | 索引 | 登录 ]

rpm based mysql5 install,版本 #16 ( #15 < #17 > ... #36)

Created by retep. Last edited by alex, 5 years and 285 days ago.. 被访问了 7,708 次。 #16

The following will install mysql 5.0 on an rhel4 distro:

If you do not have a current RHEL4 MySQL database you are using, then you may hit some 'odd' errrors during MySQL 5 install (e.g. no mysql user, e.g. mysql not starting up, e.g. grant table issues). If so then run:

{
# install mysql-server if you aren't running it already
apt-get install mysql-server
/etc/init.d/mysqld start
# read in a password and set the password
if [ -z "$rootpasswd" ]; then
echo -n 'enter password '
read rootpasswd
fi
mysqladmin password $rootpasswd
# stop mysql
/etc/init.d/mysqld stop
}

Then run the following:

function installmysql() {
# latest version at time of posting
version=5.0.27-0
major=5.0
#rhel3 may also work
distro=rhel4
files="MySQL-client-standard-$version.$distro.i386.rpm MySQL-server-standard-$version.$distro.i386.rpm MySQL-shared-compat-$version.i386.rpm"
# if you have this directive mysql server will not install so comment it out
replace "^bdb_cache_size" "#bdb_cache_size" -- /etc/my.cnf
for file in $files; do 
    if [ -e $file ]; then continue; fi
    url=http://mysql.mirrors.pair.com/Downloads/MySQL-$major/$file; 
    echo getting $url
    wget $url
    if [ $? -ne 0 ] ; then echo failed getting rpm ; return 1; fi
done
/etc/init.d/mysqld stop
if [ ! -e /etc/my.cnf.orig ]; then
mv /etc/my.cnf /etc/my.cnf.orig
fi
rpm -Uvfh $files
# need the mysql user else mysql will not start up
adduser mysql; chown -R mysql:mysql /var/lib/mysql
/bin/mv -f /usr/share/mysql/my-small.cnf /etc/my.cnf
/etc/init.d/mysql restart
chkconfig --level 35 mysql on
}
installmysql

Running Debian?

Try the >>http://dotdeb.org/ repository. Pop one of these entries >>http://dotdeb.org/mirrors into your /etc/apt/sources.list then apt get install mysql-server-5.0 (from memory).

Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.