准备篇
一、环境说明:
操作系统:Windows Server 2008 R2
PHP版本:php 5.4.4
MySQL版本:MySQL5.5.25
二、相关软件下载:
1、PHP下载地址:
http://windows.php.net/downloads/releases/php-5.4.4-nts-Win32-VC9-x86.zip
2、MySQL下载地址:
http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLInstaller/mysql-installer-5.5.25.0.msi
3、PHP加速软件ZendGuard下载地址:
http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-Windows.zip
4、Microsoft .NET Framework 4(独立安装程序)下载地址:
http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe
5、Microsoft Visual C++ 2010 可再发行组件包 (x64)下载地址:
http://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe
6、Microsoft Visual C++ 2008 Redistributable Package (x86)下载地址:
http://download.microsoft.com/download/7/5/0/7502f4e9-1f90-4895-9259-1bde67b8b9a1/vcredist_x86.exe
安装篇
一、安装IIS7.5
开始-管理工具-服务器管理器
选择“角色”点右边的添加角色
下一步
选择“Web服务器(IIS)”,下一步
下一步
确保“CGI”被选中,其他的角色服务可根据自己的需要勾选
这里全部勾选
下一步
安装
正在安装
关闭,在浏览器里面打开http://localhost/
出现下面的界面
IIS7.5安装完成
二、安装Microsoft Visual C++ 2010 可再发行组件包 (x64)
双击打开vcredist_x64.exe
选中“我已阅读并接受许可条款”,点安装
正在安装
完成
三、安装Microsoft .NET Framework 4(独立安装程序)
双击dotNetFx40_Full_x86_x64.exe
选中“我已阅读并接受许可条款”,点安装
正在安装
点完成,安装完毕。
四、安装MySQL
双击打开mysql-installer-5.5.25.0
选择第一项Install MySQL Products(安装MySQL)
选中“I accept the license terms”(我接受许可条款),点Next
选中“Skip the check for update (not recommended)”(跳过检查更新),点Next
选中“Custom”(自定义安装),Installation Path(安装路径):D:/Program Files/MySQL
Next
确保“MySQL Server5.5.25”被选中,点Next(其他的组件可以选择安装)
这里全部选中,安装所有组件
Execute (执行)
选中“我已阅读并接受许可条款”
点安装
完成
Next
Execute (执行)
Next
Next
Developer Machine(开发服务器)
Server Machine(普通服务器)
Dedicated Machine(专用服务器)
这里选择第二项: Server Machine(普通服务器)
点Next
勾选“Enable TCP/IP Networking”(开启TCP网络端口)
Port Number(端口):3306
勾选“Create Windows Service”(创建Windows系统服务)
Windows Server Name(Windows服务名):MySQL55
MySQL Root password:输入密码
Repeat Password:重复输入密码
设置好之后,点Next
Next
Next
点Finish(完成)
关闭此窗口
打开MySQL安装路径
D:/Program Files/MySQL/MySQL Server 5.5
复制my-huge.ini为my.ini
备份my-huge.ini为my-huge.ini_bak
开始-所有程序-MySQL-MySQL Server 5.5- Mysql Command Line Client
输入安装时候的MySQL root账号密码,回车
登录成功,MySQL安装完成。
五、安装Microsoft Visual C++ 2008 Redistributable Package (x86)
双击打开vcredist_x86.exe
下一步
勾选“我已阅读并接受许可条款”
点安装
完成
六、安装PHP
解压php-5.4.4-nts-Win32-VC9-x86.zip文件
重命名文件夹为php,把php文件夹拷贝到D盘根目录
解压ZendGuardLoader-php-5.3-Windows.zip
打开
D:/soft/ZendGuardLoader-php-5.3-Windows/ZendGuardLoader-php-5.3-Windows/php-5.3.x
把里面的ZendLoader.dll文件拷贝到D:/php/ext目录中
打开D:/php
复制php.ini-development为php.ini
用记事本打开php.ini
做如下修改:
extension_dir = "D:/php/ext" #设置php模块路径
date.timezone = PRC #设置时区为中国时区
register_globals = On #开启GET数据调用
short_open_tag = On #php支持短标签
cgi.force_redirect = 0 #开启以CGI方式运行php
fastcgi.impersonate = 1;
cgi.rfc2616_headers = 1
以下php扩展模块,根据需要选择开启,取消前面的分号为开始相应扩展模块
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll
extension=php_pdo_mysql.dll
在最后一行添加以下代码
[ZendGuardLoader]
zend_loader.enable=1
zend_loader.disable_licensing=1
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
zend_extension="D:/php/ext/ZendLoader.dll"
最后,保存退出
七、配置IIS支持PHP
开始-管理工具- Internet 信息服务(IIS)管理器
双击左边“起始页”下面的计算机名称
找到中间的IIS部分,打开“处理程序映射”
点右边的“添加模块映射”
请求路径:*.php
模块:FastCgiModule
可执行文件(可选):D:/php/php-cgi.exe
名称:FastCGI
最后,确定
点“是”
双击左边“起始页”下面的计算机名称
找到中间的IIS部分,打开“FastCGI设置”
右键选中:D:/php/php-cgi.exe然后选择编辑
监视对文件所做的更改:D:/php/php.ini
环境变量,点旁边的安装
点“添加”

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB

MySQL/InnoDB supports four transaction isolation levels: ReadUncommitted, ReadCommitted, RepeatableRead and Serializable. 1.ReadUncommitted allows reading of uncommitted data, which may cause dirty reading. 2. ReadCommitted avoids dirty reading, but non-repeatable reading may occur. 3.RepeatableRead is the default level, avoiding dirty reading and non-repeatable reading, but phantom reading may occur. 4. Serializable avoids all concurrency problems but reduces concurrency. Choosing the appropriate isolation level requires balancing data consistency and performance requirements.

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.