[root@yangwenjun www]# tar xzfv mysql-standard-4.1.14-pc-linux-gnu-i686.tar.gz [root@yangwenjun www]# cd mysql-standard-4.1.14-pc-linux-gnu-i686 [root@yangwenjun mysql-standard-4.1.14-pc-linux-gnu-i686]# more INSTALL-BINARY
认真的阅读一下这个文档,就会发现MySQL很容易安装
[root@yangwenjun mysql-standard-4.1.14-pc-linux-gnu-i686]# groupadd mysql [root@yangwenjun mysql-standard-4.1.14-pc-linux-gnu-i686]# useradd -g mysql mysql [root@yangwenjun www]# mv mysql-standard-4.1.14-pc-linux-gnu-i686 /home/www/mysql [root@yangwenjun www]# cd /home/www/mysql [root@yangwenjun mysql]# scripts/mysql_install_db --user=mysql [root@yangwenjun mysql]# chown -R root . [root@yangwenjun mysql]# chown -R mysql data [root@yangwenjun mysql]# chgrp -R mysql . [root@yangwenjun mysql]# bin/mysqld_safe --user=mysql &
这样MySQL就已经启动了,下面为root用户设置密码:
[root@yangwenjun mysql]# ./bin/mysqladmin -u root password ‘password’ [root@yangwenjun mysql]# ./bin/mysqladmin -u root -h localhost.localdomain password 'pass' [root@yangwenjun mysql]# ./bin/mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 4.1.14-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
[root@yangwenjun mysql]# cp support-files/mysql.server /etc/init.d/mysql [root@yangwenjun mysql]# vi /etc/init.d/mysql 修改如下定义使其内容为: basedir=/home/www/mysql datadir=/home/www/mysql/data [root@yangwenjun mysql]# chkconfig --level 345 mysql on [root@yangwenjun mysql]# service mysql restart Shutting down MySQL... [ OK ] Starting MySQL [ OK ] [root@yangwenjun mysql]#
到这里MySQL就装好了。
3、安装Apache [root@yangwenjun httpd-2.0.54]# cd /home/bruce/software/www/httpd-2.0.54 [root@yangwenjun httpd-2.0.54]# ./configure --prefix=/home/www/apache --enable-module=most --enable-shared=max --enable-so [root@yangwenjun httpd-2.0.54]# make [root@yangwenjun httpd-2.0.54]# make install