MySQL installation configuration
Many new users are used to using the exe installation package to configure MySQL in windows. After installing MySQL multiple times using the installation package, errors may occur if MySQL is not fully uninstalled. We recommend that you use the official MySQL installation package-free installation package to install the configuration, so as to avoid the problem of clearing the registry and incomplete residual files.
1. Download the MySQL installation package without installation. Official website: http://www.mysql.com/downloads/mysql/ choose noinstall winx64 version, such as: mysql-noinstall-5.1.66-winx64.zip. (The test platform is windows server 2008 R2, 64-bit. We recommend that you use the 64-bit version without installation package. Although the 64-bit version is compatible with 32-bit versions, if the 32-bit version is used, a 1067 error may occur during mysql startup.) decompress the package to D:/mysql5.1.
2. Set environment variables
Add system environment variables. Variable name: MYSQL_HOME variable value: D:/mysql5.1;
Modify the path of the system variable and add % MYSQL_HOME %/bin;
3. Configure the my. Ini file
A) copy D:/mysql5.1/my-medium.ini and modify it to my. ini
B) modify my. ini settings
Find the [client] in the file (the green part is the part to be added ):
# The following options will be passed to all MySQL clients
[Client]
# Password = your_password
Port = 3306
Socket = MySQL
Default-character-set = gbk
Find The [mysqld] in The file (The green part is The part to be added): # The MySQL server
[Mysqld]
Basedir = "D:/mysql5.1"
Datadir = "D:/mysql5.1/data"
Default-character-set = utf8
Port = 3306
Socket = MySQL
4. Add mysql to the system service
Run mysqld -- install mysql -- defaults-file = D:/mysql5.1/my. ini as the system administrator.
5. Start the service
Run: net start mysql as the system administrator on the command line
6. Log on to the CLI
Run mysql-uroot-p in the command line as a system administrator.
7. Modify the root password
Mysql> update user set password = password ('New password') where user = 'root ';
Echo
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
Mysql> flush privileges;
Echo
Query OK, 0 rows affected (0.00 sec)
Mysql> quit
Exit SQL
【
Start Service: net start mysql
Stop Service: Run: net stop mysql on the command line
Delete service: mysqld -- remove mysql
]
Apache installation configuration
1. Download the apache_2.2.14-win32-x86-no_ssl.msi on Apache official website. (Each version has two types: no_ssl and openssl. openssl is the ssl security authentication mode, and its protocol is HTTPS rather than HTTP. This is the difference between a server with SSL and a general web server. Generally, you can download the no_ssl version .)
2. Click install Apache and enter the correct information. Suppose we install it in the D:/apache2.2 folder.
3. after the installation is complete, apache is automatically started. Enter http: // localhost/or http: // 127.0.0.1/in the address bar of the browser. If "It works. "At the same time, there is a green apache server running icon in the taskbar in the lower right corner of the computer, indicating that the installation is successful.
4. Modify the httpd: conf configuration file.
A) find "DocumentRoot". Here is the Directory of the specified home page. The default value is "D:/apache2.2/htdocs". You can use the default directory or define it yourself, for example, "D:/www ". Note: Do not add "/" at the end of the Directory. Now we use "D:/apache2.2/htdocs ".
Borydirectdirectdirectoryindex”, which is the name of the first page. You can add index. php to the end of index.html. Type.
C) If You modify the path of the default homepage, You must make the following changes (You don't have permission to access/on this server may be prompted ):
Search
<Directory/>
Options FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all
</Directory>
To:
<Directory/>
Options FollowSymLinks
AllowOverride None
Order deny, allow
Allow from all
</Directory>
5. Modify the httpd: conf file and restart apache.
PHP installation configuration
1. Download the php-5.2.17-Win32-VC6-x86 on the PHP official website. Official website: http://www.php.net/downloads.php (VC6 version is compiled using visual studio6 for apache; VC9 version is compiled using Visual Studio 2008 for IIS. TS refers to Thread Safety, which is Thread security. This version is generally selected when IIS is loaded as an ISAPI. The NT is None-Thread Safe. This version is generally selected when running in fast cgi mode, which has better performance .)
2. Decompress the compressed package to the D:/php5.1 directory.
3. Rename the PHP. ini-dist file under the php Directory (D:/php5.1) to php. ini.
4. Modify the php. Ini file
A) extension_dir = "D:/php5.1/ext", pointing to the path where the "php _ *. dll" file is placed in the php folder. The paths of PHP4 and PHP5 are different here.
B) doc_root = "D:/apache2.2/htdocs", pointing to the home page set in apache.
C) default_charset = "gb2312", modify the default character set. Here, if there is a semicolon ";" in front, remove this semicolon;
D) change register_globals = Off to register_globals = On to make the passed global variable valid;
E)
Extension = php_dba.dll if there is a semicolon in front, cancel the semicolon, the same as below;
Extension = php_dbase.dll
Extension = php_gd2.dll GD library is used for drawing verification codes;
Extension = php_mysql.dll is used to connect to the MYSQL database;
F) change the Off value of output_buffering to On.
5. After modification, copy the php. ini file to the C:/WINDOWS/directory.
6. Copy the php5ts. dll file under the PHP directory to the C:/WINDOWS/system32 directory.
7. Modify the httpd. conf file of Apache. Add the following two lines at the end of the file to install PHP in the module mode to enter Apache:
LoadModule php5_module D:/Program Files/Php/php5apache2_2.dll
AddType application/x-httpd-php. php
Note:
1. The directory delimiter in the apache configuration file httpd. conf is "/", while the directory in the PHP configuration file php. ini must be a backslash "/".
2. In windows, the default format of UTF-8 + BOM is saved by editing the document with notepad.
]
Now we have completed the wamp environment installation and configuration for windows server 2008.