第一步:下载mysql-5.0.67.tar.gz
第二步:安装mysql-5.0.67
<1>解压mysql-5.0.67.tar.gz
# tar xzvf mysql-5.0.67.tar.gz
<2>创建安装目录
# mkdir /usr/local/mysql
<3>安装配置
# cd mysql-5.0.67 ← 修改为可执行
# ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-Community --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=utf8 --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
files in the Docs directory.
Thank you for choosing MySQL!
第三步:编译·安装
<1># make ← 由于安装配置时做了很多优化,因而过程比较长,请耐心等待
<2># make install
第四步:安装后的配置
# useradd mysql ← 添加 mysql 用户
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . ← 设置权限,注意后面有一个 "."
# chown -R mysql /var/lib/mysql ← 设置 mysql 目录权限
# chgrp -R mysql . ← 注意后面有一个 "."
# cp share/mysql/my-huge.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld ← 开机自动启动 mysql。
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# /etc/rc.d/init.d/mysqld start ← 启动 MySQL
# bin/mysqladmin -u root password 123456
# service mysqld stop ← 关闭 MySQL
第六步:运行方法
# cd /usr/local/mysql/bin
# ./mysql -uroot -p123456