近日在CentOS下安装配置成功了MySQL-5.0.27(事实上这种安装方法适合任何Linux版本),特记下来备忘。^_^
1. 下载mysql-5.0.27.tar.gz: http://www.ntu-tw.lkams.kernel.org/pub/MySQL/Downloads/MySQL-5.0/
2. 安装
·解压
| # tar xzvf mysql-5.0.27.tar.gz |
·安装配置
| # cd mysql-5.0.27 MegaEntry - Social networking and discussion site! # mkdir /program/mysql# ./configure --prefix=/program/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-Community --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug |
配置成功后会提示:
MySQL has a Web site at http://www.mysql.com/ which carries details on the latest release, upcoming features, and other information to make your work or play with MySQL more productive. There you can also find information about mailing lists for MySQL discussion.
Remember to check the platform specific part of the reference manual for hints about installing MySQL on your platform. Also have a look at the
CopyRight owned by the original author.--(www.MegaEntry.com)
files in the Docs directory.Thank you for choosing MySQL!
·编译
|
#make |
过程比较长(配置时做了很多优化),请耐心等待
·安装
| #make install |
3. 安装后的配置
# useradd mysql //添加 mysql 用户# cd /program/mysql# bin/mysql_install_db --user=mysql# chown -R root:mysql . //设置权限,注意后面有一个 "."# chown -R mysql /var/lib/mysql //设置 mysql 目录权限 MegaEntry - Social networking and discussion site!
MegaEntry - Social networking and discussion site!
# bin/mysqladmin -u root password "password_for_root"# service mysqld stop //关闭 MySQL