The installation configuration of Apache, PHP, and MySQL is introduced in the first two sections. The installation of phpMyAdmin is more like the installation of a PHP application. I will install a wiki or CMS system later.
See:
Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (1)
Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (2)
Iv. phpMyAdmin
PhpMyAdmin is one of the most popular and active open software for managing MySQL through web. It is my first choice. Although there is a GUI tool used to manage MySQL, however, this tool is still very popular.
1. Download and install:
First, download can go to the official site of sourceforge.net download: http://sourceforge.net/project/showfiles.php? Group_id = 23067
Because phpMyAdmin is actually written in PHP, it does not rely on hardware and operating systems, but requires your system to support PHP.
I download the zippack with the latest stable version 3.11(your personal questions, in the format of .7z ).
After downloading and decompressing the package, you need to decide how to run it. My choice is to put it in the mysqladmin directory in the documents of APACHE service, so that I can use http: // localhost/mysqladmin/index. PHP to run it.
After the above copy is completed, the installation is complete.
Note that each downloaded and decompressed file contains the quarantine information of OS X Leopard. For how to delete the quarantien, see my previous blog: Quarantine "quarantine" function of leopard.
2. configuration process:
A. correct permissions: Set correct permissions for scritps files. The principle is that the owner is you/Administrator, and the group should be the Apache running group. In leopard, the group name is _ www. for others, you can set it to 0-no access permission.
Because the permissions of all files are not in the _ www group after decompression, you need to change it:
Shell> sudo chown-R: _ www/library/webserver/documents/mysqladmin/
Shell> sudo chmod-r g + XW/library/webserver/documents/mysqladmin/Libraries
In this way, the permissions are set. If you have any questions, please refer to the official documentation FAQ 4.2:
B. Environment Settings:
A. Traditional MethodsIs to manually generate config. inc. PHP file, the system comes with a config. default. inc. PHP file, you can copy it as config. inc. PHP file, and then edit it. I think you can use the following configuration. For security issues, you can:
- /* Server: localhost [1] */
- $ I ++;
- $ Cfg ['servers'] [$ I] ['host'] = 'localhost ';
- $ Cfg ['servers'] [$ I] ['Port'] = '';
- $ Cfg ['servers'] [$ I] ['sockets '] = '';
- $ Cfg ['servers'] [$ I] ['connect _ type'] = 'tcp ';
- $ Cfg ['servers'] [$ I] ['extension'] = 'mysqli ';
- $ Cfg ['servers'] [$ I] ['auth _ type'] = 'http ';
B. Configuration File Settings:
Use the following method to set the wizard environment. This method is added to the new phpMyAdmin.
Create a Config directory in the mysqladmin directory and grant the correct permissions. Then copy a config. Inc. php file to the config directory:
- Shell> Cd/library/webserver/documents/mysqladmin/
- Shel> mkdir config
- Shell> chmod o + RW config
- Shell> CP config. Default. Inc. php config/config. Inc. php
- Shell> chmod o + W config/config. Inc. php
Open the browser: Enter http: // localhost/mysqladmin/setup and complete the setting steps. Then, copy the set parameter file to the running environment.
- Shell> MV config/config. Inc. php.
- Shell> chmod o-RW config. Inc. php
C. Run the test. The following error occurs:
System prompt:Access Denied: #2002-the server is not responding (or the local MySQL server's socket is not correctly configured ).Other errors such:Warning: mysql_connect () http://function.mysql-Connect: Can't connect to local MySQL server through socket '/var/MySQL. Sock'
What should I do? The key to the problem is found through searching and practice: Because the socket file created during the initial running of the new MySQL OS X version is not the previous directory, it is replaced with the/tmp directory, so many programs cannot be found.
One way you can modify the above config. inc. in the PHP file, replace = "" With = "/tmp/MySQL. sock ", but this can only work for phpMyAdmin, other programs will prompt MySQL error.
A better way is to modify the PHP settings that come with OS X, so that programs that apply PHP and obtain MySQL socket from PHP can run without modification.
The modification method is as follows:
Edit the/etc/PHP. ini file in the text and find "mysql_default_socket =" and change it to "mysql_default_socket ="/tmp/MySQL. Sock "to restart Apache. The problem is solved.