Linux and Solaris build Apache virtual Root environment (2)

Source: Internet
Author: User
Tags add dba mysql mysql database perl script linux

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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.