SUSE Linux下源码编译安装apache2.2.6+php5.1.16+mysql5.0.40
文档
一、编译mysql 5.0.40
#cd /usr/local/src
# tar zxvf mysql-5.0.40.tar.gz
# cd mysql-5.0.46
#./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=utf8 --with-collation=utf8_general_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 --without-isam
配置成功会提示:
MySQL has a Web site at
http://www.doczj.com/doc/c816023243323968011c92e1.html/
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
编译安装完成后执行后续操作:
# 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/http://www.doczj.com/doc/c816023243323968011c92e1.htmlf /etc/http://www.doczj.com/doc/c816023243323968011c92e1.htmlf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld //开机自动启动mysql。# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# /etc/init.d/mysqld start //启动MySQL
#/usr/local/mysql/ bin/mysqladmin -u root password "password_for_root" // password_for_root为密码.本机是mysql
#/usr/local/mysql/bin/mysql –u root –p //进入mysql客户端
(/usr/local/mysql/bin/mysql –u root –p 提示Enter password: 输入密码,回车进入)