Hara http://www.cnblogs.com/martin1009/archive/2011/11/11/2245794.html
1. Fromwww.apachefriends.orgDownload the latest version of XAMPP for Windows, I'm underXAMPP Windows 1.7.1 Installer.
2. Double-click the installation and install it directly in the default directoryUnder the C:\XAMPP.
3. During installation, XAMPP Option: Service Selection The followingInstallApache as ServiceAndInstall MySQL as serviceSelected.
4. Always next until finish, if 80 ports, 3306 ports, and 25 ports are not disabled, it is best to turn off the firewall.
5.MySQL permissions: XAMPP The default installed MySQL administrator isRoot, the password isEmpty, first you need to set a password for the administrator:
Start-run--CMD--CD C:\xampp\mysql\binmysqladmin-u root Password 123(Set the password to root to 123, you are also set as you want) to open in the C:\xampp\phpMyAdmin folderconfig.inc.php, find$cfg [' Server '] [$i] [' Password ']= '; Change it to:$cfg [' Server '] [$i] [' Password ']= ' 123 ';Create users and privileges: to improve the security of the program, the app always creates new users for accessing the database, rather than always using the root user. GRANT privileges on database.* to usrname identified by ' password '
Privileges Refers to what privileges the user has on a specially-defined database (Select,insert,update,delete,index ... ), can generally be used AllTo represent all the privileges.database.*Indicates which databases and tables the user can work with.Database.tablenameDevelop a specific table, or use*.*To allow each database.usernameYou can restrict a user to a specific hostname, which can be a computer running MySQL, such as localhost, or an IP address that runs MySQL on a remote computer (such as [email protected] or [email protected] remote computer IP address).
For example, I create an EMI user on this machine, I can write on the MySQL command line:
GRANT all on * * to [e-mail protected] idntified by ' 123 ';
then Start-run--CMD--CD c:\xampp\mysql\bin, entermysql-u root-p, and then enter the password to get to the MySQL Welcome screen.
6. Modify the MySQL default character set
After entering the MySQL command line, Mysql>status will then show the MySQL default character set to Latin1:
Server characterset:latin1
Db characterset:latin1
Client characterset:latin1
Conn. Characterset:latin1
To change to UTF8:
mysql> SET character_set_client = UTF8;
mysql> SET character_set_connection = UTF8;
mysql> SET character_set_database = UTF8;
mysql> SET character_set_results = UTF8;
mysql> SET character_set_server = UTF8;
mysql> SET collation_connection = UTF8;
mysql> SET collation_database = UTF8;
mysql> SET collation_server = UTF8;
After this modification, the MySQL service reboot seems to be back to the previous, it is recommended to modify the My.ini file.
View the default character set (by default, MySQL's character set is Latin1 (iso_8859_1)
In general, the settings for viewing the character set and ordering of the system can be set through the following two commands:
mysql> SHOW VARIABLES like ' character% ';
+--------------------------+---------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | Latin1 |
| character_set_connection | Latin1 |
| Character_set_database | Latin1 |
| Character_set_filesystem | binary |
| Character_set_results | Latin1 |
| Character_set_server | Latin1 |
| Character_set_system | UTF8 |
| Character_sets_dir | D: "mysql-5.0.37" Share "charsets" |
+--------------------------+---------------------------------+
mysql> SHOW VARIABLES like ' collation_% ';
+----------------------+-----------------+
| variable_name | Value |
+----------------------+-----------------+
| collation_connection | Utf8_general_ci |
| Collation_database | Utf8_general_ci |
| Collation_server | Utf8_general_ci |
+----------------------+-----------------+
Modifying the default character set
The simplest way to modify this is to modify the character set key values in the MySQL My.ini file.
such as Default-character-set = UTF8
Character_set_server = UTF8
After the modification, restart the MySQL services, service MySQL restart
Use mysql> show VARIABLES like ' character% '; view, discover that database encoding has been changed to UTF8
+--------------------------+---------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | D: "mysql-5.0.37" Share "charsets" |
+--------------------------+---------------------------------+
XAMPP (Apache+mysql+php+perl) is a powerful PHP Web development integration package. Application XAMPP can easily build the environment of PHP and other programs under various systems.
The first time today to build xampp found a problem, Apache can not start, no matter how many clicks start, are shown as follows:
Busy ...
Apache started
My Windows 7 system has IIS installed by default (I'm going to use it for ASP development), apparently because port 80 is occupied, so this port is busy, which can cause Apache to fail to boot. Solution I Google a bit, said a lot of many kinds of .... WHY?XAMPP is usually used for PHP development to quickly build php+mysql+apache environment, the actual server environment application at least I will be built. Since it is the development environment you will be good, my ASP IIS server is the default web80 port for Windows, the JSP uses the Tomcat server is the default port 8080 when Tomcat installation, Then PHP xampp inside the Apache I will change its default port 80 to 8081 (any other as long as not be occupied on it) the other is OK (said here to think of who is not a person who has to see what is the Web default port, do not understand the words of TCP/IP, Your basic knowledge does not understand is the sand building, will never be high.
So how do I change the Apache port?
To XAMPP installation directory, click into apache\conf, you can see the "httpd.conf" file, open with a text editor, change all 80 to 8081, Listen 80-〉listen 8081
ServerName Localhost:80-〉servername localhost:8081
Then restart Apache in the Xampp Control panel.
How to also display the following:
Busy ...
Apache started
Tube It 3,721, enter the address in IE: http://localhost:8081/test, can't open, all modify Apache port, try to stop IIS Web service. Start again
Apache. It also shows the following:
Busy ...
Apache started [Port 80]
IE input address: http://localhost:8081/Test, successfully opened XAMPP Web page, prompt:
Welcome to XAMPP for Windows Version 1.6.8!
Congratulations to you:
You have successfully installed the xampp!
Although the Xampp-control dialog box shows that Apache has started port 80, the actual occupancy port is 8081. And then restart the IIS service, both Apache and IIS can work on their own 8081 and 80 ports.
Restart the computer, Apache is not available, try to shut down the IIS service, start Apache-〉http://localhost:8081/test success, and then start the IIS service,
HTTP://LOCALHOST:8081/Test Success
Really is a very strange debugging process, anyway, it can be used,
Direct Xampp\apache_start.bat boot Apache, prompted 443 port occupancy, the original IIS occupied the SSL port (that is, 443 port https), this is done, modify the Xampp\xampp\apache\conf\extra\ httpd-ssl.conf file, change all 443 to 4433 or turn off SSL service and test everything again OK.
XAMPP debugging process while doing side writing, thinking with chaos ...
Summary: The solution that Apache cannot start in XAMPP is simply to modify ports 80 and 443. When you start XAMPP, you can modify the port of this software if you report 80/443 ports being accounted for
Open the xampp\apache\conf\httpd.conf file to change 80 to 8081, open the xampp\apache\conf\extra\httpd-ssl.conf file to modify 443 to 4433, or turn off the SSL extension ( It's debug anyway).
Window on the PHP development Environment (XAMPP)