红联Linux门户
Linux帮助

redhat安装mysql备忘

发布时间:2008-07-15 00:02:51来源:红联作者:Qnoer
chmod 755 mysql-5.0.45.tar.gz
# tar -zxvf mysql-5.0.45.tar.gz -C /usr/src/
# cd /usr/src/mysql-5.0.45
# ./configure --prefix=/usr/local/mysql --with-charset=gbk --localstatedir=/usr/local/mysql/data
# make
# make install
# groupadd mysql
# useradd mysql -g mysql
# cd /usr/local/mysql/bin
# ./mysql_install_db --user=mysql

# cd /usr/local/mysql
# chown -R root .
# chown -R mysql data
# chown -R mysql data/ .
# chown -R mysql data/mysql/ .
# chgrp -R mysql .
# /usr/local/mysql/bin/mysqld_safe --user=mysql &
# netstat -tnl |grep 3306
# /usr/local/mysql/bin/mysql -uroot -p
# show database;
# /usr/local/mysql/bin/mysqladmin -uroot password 6220104
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# cd /etc/init.d/
# chmod +x mysqld
# chkconfig mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# service mysqld stop

# cp /usr/local/mysql/bin/* /usr/bin/

到此mysql-5.0.45 安装完成。
文章评论

共有 2 条评论

  1. wangchengming12 于 2010-04-25 10:54:27发表:

    顶下!

  2. wst021 于 2010-03-29 13:37:30发表:

    这是转贴,还是原创啊?