Integration of Apache, php3, and MySQL in Linux _ MySQL

Source: Internet
Author: User
Tags uncompress
Author: idea Note: idea will generate a mysql-3.23.32 Directory moved to the usrlocalmysqlmvmsql-3.23.32 Apache


Author: knetfox
  
1. installation package
Apache_1.3.19.tar.gz
Php-4.0.4.tar.gz
Mysql-3.23.32.tar.gz
Note: The above are source code, not RPM packages.
  
2 Software Installation
2.1 uncompress the package
  
Cd/usr/local
Tar-zvxf mysql-3.23.32.tar.gz
  
Move the generated mysql-3.23.32 directory to/usr/local/mysql
  
Music msql-3.23.32/usr/local/mysqly
  
2.2 compile MySQL
  
Cd/usr/local/mysql
./Configure -- prefix =/usr/local/mysql
Make
Make install
  
2.3 install database files
  
/Usr/local/mysql/scripts/mysql_install_db
/Usr/local/mysql/bin/safe_mysqld &
  
2.4 MySQL authorized operations
  
MySQL's access control technology is more flexible than IPVs. The username and password encryption algorithms used by MySQL are different from those used by Unix systems. the username can be up to 16 characters long.
Log on to MySQl as root, and then type grant all privileges on * at the MySQL prompt *. * to thj @ localhost identified by 'thj' with grant option; in this way, MySQL can be used no matter where thj logs in to this server.
  
2.5 simple MySQL database operation statement
  
Create a database
Command: create database name;
Delete database
Command: drop database name;
Query the databases in MySQL.
Command: show databases;
Change the currently used database
Command: use tbl_name
Create a data table
Command: create table tbl_name (column_specs );
Description: tbl_name description of columns in the column_specs table
Queries the structure of a specified data table.
Command: describe tbl_name;
Query the data tables in the database.
Command: show tables;
Add new record
Command: insert into tbl_name (col_name1, col_name2 ,...) Values (values1, values2 ,....)
Note: The insert statement is easy to use, but it also has a defect that only one record can be inserted at a time.
Batch load data
Command: load data local infile "filename.txt" into table tbl_name;
Note: the MySQl version must not be earlier than 3.22.15. otherwise, load data local does not work. This statement actually calls/usr/bin/mysqlimport.
Search information
Command: select the conditions that must be met for where data from one or more tables.
Note: In MySQL, after each command is entered, you must press ";" at the end of the command line to mark a command, or press enter and then press go, the system prompts you to execute the preceding commands. In most MySQL reference books, the commands are in upper case and can be in lower case. Also, the use statement can be left blank ";", this is the only statement in all MySQL languages that can be executed without adding.
  
Note: the installation of MySQL ends here.
  
3. hybrid compilation of Apache and PHP3
  
3.1 uncompress the package
  
Cd/usr/local
Tar xvzf apache_1.3.19.tar.gz
Tar xvzf php-4.0.4.tar.gz
Mv apache_1.3.19.tar.gz apache
Music php-4.0.4.tar.gz php
  
Set the Apache installation directory to/usr/local/apache
  
Cd apache
./Configure -- prefix =/usr/local/apache -- with-port = 8000
  
The configuration supports MySQL, is used as the Apache function module, and is valid for tracking variables.
  
Cd ../php
. /Configure -- with-mysql =/usr/local/mysql -- with-apache = .. /apache -- enable-track-vars-with-pgsql =/usr/lib/pgsql -- prefix =/usr/local/apache/php-with-config-file-path =/ usr/local/apache/php
Make
Make install
  
Note: PHP installation ends here
  
3.2 configure Apache and add the PHP4 module
  
Cd ../apache
Cp/usr/local/php/libs/libphp4.a/usr/local/apache/src/modules/php4
./Configure -- prefix =/usr/local/apache -- activate-module = src/modules/php4/libphp4.a -- with-port = 8000
Make
Make install
  
Note: APACHE installation is complete.
  
3.3 change configuration
  
Copy the php. ini file to the/usr/local/apache/php directory.
  
Cd ../php
Cp php. ini-dist/usr/local/apache/php/php4.ini
  
Change Apache configuration file
  
Cd/usr/local/apache/conf
Vi httpd. conf
  
Find AddType application/x-httpd-php. php4 and delete the # number in front of it. of course, you can also add a line of AddType application/x-httpd-php3.asp so that it is easier to edit with FrontPage.
Run/usr/local/apache/bin/apachectl start to start the apache process.
  
  

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.