4.9 Here is a small Perl script that removes most of the comments from the generated configuration file and forms a simplified file.
4.10 Giving ownership of the Htdocs directory tree to the owner of the web directory tree
root# Chown-r 888:888/www/apache/htdocs
5. Compiling and installing MySQL
MySQL is not installed on the virtual root environment of the directory tree, in fact, it may be installed on other systems. But in my case, it was installed with Apache on a Web server.
This example includes generating user and database locations, and generating the initial database
5.1 Build user, he will be the owner of MySQL database.
For example: Generate a user 777:777 in home/mysql/
root# Groupadd-g 777 Mysqldba
root# useradd-c "MySQL DBA"-d/home/mysql-u 777-g 777-m-n MySQL
5.2 Unlock the original code, and the original directory tree to the users of MySQL
root# Groupadd-g 777 Mysqldba
root# useradd-c "MySQL DBA"-d/home/mysql-u 777-g 777-m-n MySQL
5.3 Now as a MySQL user, create a directory for the MySQL database and start installing and compiling MySQL
$ mkdir ~/db ## where the DB will reside
$ cd /usr/local/src/mysql-3.22.27
$ ./configure --localstatedir=/home/mysql/db --prefix=/usr/local/mysql
$ make
$ make install
5.4 生成*MySQL*授权表(只有在安装*MySQL之前,这才是必须的)
$ ./scripts/mysql_install_db
5.5 安装和修改数据库的启动脚本,将数据库的所有者从root变为mysql
<CENTER><ccid_nobr>
<table width="400" border="1" cellspacing="0" cellpadding="2"
bordercolorlight = "black" bordercolordark = "#FFFFFF" align="center">
<tr>
<td bgcolor="e6e6e6" class="code" style="font-size:9pt">
<pre><ccid_code>
ROOT# cd /usr/local/src/mysql-3.22.27/
ROOT# cp support-files/mysql.server /etc/rc.d/init.d/
ROOT# chmod 755 /etc/rc.d/init.d/mysql.server
ROOT# [ edit /etc/rc.d/init.d/mysql.server: ]
mysql_daemon_user=mysql ## so we can run mysqld as this user.
ROOT# chkconfig --add mysql.server ## permanently add server to rc scripts