在CentOS下安装配置MySQL过程
[ 2010-10-19 00:08:31 | 作者: admin ]
http://log.hnb.cn/index.php/archives/49.html/comment-page-1
1. 下载mysql-5.0.77.tar.gz: http://www.ntu-tw.lkams.kernel.org/pub/MySQL/Downloads/MySQL-5.0/
2. 安装
·解压
# tar xzvf mysql-5.0.77.tar.gz
·安装配置
配置成功后会提示:
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!
·编译
#make
过程比较长(配置时做了很多优化),请耐心等待
·安装
#make install
3. 安装后的配置
将mysql的配置文件copy到/etc目录下,并更名为my.cnf
跟句机器配置的不同选择不同的文件:
1. 下载mysql-5.0.77.tar.gz: http://www.ntu-tw.lkams.kernel.org/pub/MySQL/Downloads/MySQL-5.0/
2. 安装
·解压
# tar xzvf mysql-5.0.77.tar.gz
·安装配置
# cd mysql-5.0.77
# mkdir /usr/local/mysql
# ./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-collation=utf8_unicode_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-isam --without-ndb-debug --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
# mkdir /usr/local/mysql
# ./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-collation=utf8_unicode_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-isam --without-ndb-debug --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
配置成功后会提示:
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!
·编译
#make
过程比较长(配置时做了很多优化),请耐心等待
·安装
#make install
3. 安装后的配置
将mysql的配置文件copy到/etc目录下,并更名为my.cnf
跟句机器配置的不同选择不同的文件:
/user/local/mysql/share/mysql/my-small.cnf 最小配置安装,内存<=64M,数据数量最少
/user/local/mysql/share/mysql/my-large.cnf 内存=512M
/user/local/mysql/share/mysql/my-medium.cnf 32M<内存<64M,或者内存有128M,但是数据库与web服务器公用内存
/user/local/mysql/share/mysql/my-huge.cnf 1G<内存<2G,服务器主要运行mysql
/user/local/mysql/share/mysql/my-innodb-heavy-4G.cnf 最大配置安装,内存至少4G
# groupadd mysql //添加MySQL组
# useradd -g mysql mysql//添加 mysql 用户
# cd /usr/local/mysql //进入MySQL的安装目录
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置权限,注意后面有一个 “.”
# chown -R mysql /var/lib/mysql //设置 mysql 目录权限
# chgrp -R mysql . //注意后面有一个 “.”
# bin/mysqld_safe --user=mysql & //启动mysql,如果一切正常的话,运行此命令后,不会有任何提示。
# bin/mysqladmin -u root password password //修改root用户的密码,这里的root用户指的是mysql的root用户,与Linux的root用户无关。
# bin/mysql -u root -p //如果正常的话,用这个名字可以登录,在输入密码后,出现mysql > 的提示符表明登录成功。用quit命令可退出以下命令用于设置mysql开机自动运行
# cd mysql-5.0.77 //再次进入解压后的目录,即源码目录。
# cp support-files/mysql.server /etc/init.d/mysql //将mysql.server这个文件copy到/etc/init.d/目录下,并更名为mysql
# chmod 755 /etc/init.d/mysql //给/etc/init.d/mysql这个文件赋予“执行”权限
# chkconfig --add mysql //加入到开机自动运行
# service mysql restart //重新启动MySQL
/user/local/mysql/share/mysql/my-large.cnf 内存=512M
/user/local/mysql/share/mysql/my-medium.cnf 32M<内存<64M,或者内存有128M,但是数据库与web服务器公用内存
/user/local/mysql/share/mysql/my-huge.cnf 1G<内存<2G,服务器主要运行mysql
/user/local/mysql/share/mysql/my-innodb-heavy-4G.cnf 最大配置安装,内存至少4G
# groupadd mysql //添加MySQL组
# useradd -g mysql mysql//添加 mysql 用户
# cd /usr/local/mysql //进入MySQL的安装目录
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置权限,注意后面有一个 “.”
# chown -R mysql /var/lib/mysql //设置 mysql 目录权限
# chgrp -R mysql . //注意后面有一个 “.”
# bin/mysqld_safe --user=mysql & //启动mysql,如果一切正常的话,运行此命令后,不会有任何提示。
# bin/mysqladmin -u root password password //修改root用户的密码,这里的root用户指的是mysql的root用户,与Linux的root用户无关。
# bin/mysql -u root -p //如果正常的话,用这个名字可以登录,在输入密码后,出现mysql > 的提示符表明登录成功。用quit命令可退出以下命令用于设置mysql开机自动运行
# cd mysql-5.0.77 //再次进入解压后的目录,即源码目录。
# cp support-files/mysql.server /etc/init.d/mysql //将mysql.server这个文件copy到/etc/init.d/目录下,并更名为mysql
# chmod 755 /etc/init.d/mysql //给/etc/init.d/mysql这个文件赋予“执行”权限
# chkconfig --add mysql //加入到开机自动运行
# service mysql restart //重新启动MySQL
[最后修改由 admin, 于 2010-10-19 00:13:56]
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1506
这篇日志没有评论。
此日志不可发表评论。