安装MYSQL。http://dev.mysql.com/downloads/mysql/5.5.html 根据自己的需要下载即可,我这里下载的是 Windows (x86, 64-bit), MSI Installer 。点击左边的download 开始下载。
//注:我这里是win764位环境,具体的版本请视自己实际情况而定
下载之后,双击开始安装。
1、同意条款之后,首先是让你选择安装模式。有三种:①、典型安装(安装常用的一些东西)。②、自定义安装(自己可以选择性的进行安装,并且可以选择安装位置)。③、全部安装。
//注:好像是Mysql5.5版本之后的才有‘全部安装’这个选项,之前的版本只有①和②选项。
//注:这里全是个人理解,本人英语也是半调子水平。
2、我选择的是第二个'Custom',点击"Custom",出现一个窗口,可以选择安装位置(自己随便选择即可),我这里就安装到C盘了。
3、然后next,install。
4、然后会出现一个新的窗口,继续next。
5、在接下来的窗口中选择“Launch the Mysql Instance configuration wizard”(启动数据库实例配置向导),然后点击 finish。
6、出现了配置界面,继续next。然后出现两个选项:Detailed Configuration(详细配置)和Standard Configuration(标准配置)。Standard Configuration(标准配置)选项适合想要快速启动MySQL而不必考虑服务器配置的新用户。详细配置选项适合想要更加细粒度控制服务器配置的高级用户。
7、我们这里选择标准配置 Standard Configuration。出现一个新的窗口:install as windows service(作为windows服务安装),下面的选项include bin directory in windows path(在windows的path环境变量中添加mysql bin的路径)[经常使用命令行管理mysql的可以勾选此选项]
8.继续next,然后出现设置root密码。自己设置了即可。
9、漫长的设置终于结束了,execute即可。。。
打开dos命令提示符窗口,输入 mysql -uroot -p你的SQL密码。然后回车,如果可以登陆。
恭喜你,MySQL安装成功。
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#默认目录是这个: DocumentRoot "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
#现在改为下面的这个
DocumentRoot "E:/wamp/www"
继续搜索Directory,找到一行“This should be changed to whatever you set DocumentRoot to”下的directory 进行修改
#
# This should be changed to whatever you set DocumentRoot to.
#
#原本是这个<Directory "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs">
#现在改为如下:
<Directory "E:/wamp/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#让apache可以识别php后缀的网页
AddType application/x-httpd-php .php
搜索“LoadModule”,在里面加上如下图所示
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule php5_module E:/wamp/php/php5apache2_2.dll
#PHP配置文件所在路径
PHPIniDir "E:/wamp/php"
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
在里面加上 LoadModule php5_module E:/wamp/php/php5apache2_2.dll 和 PHPIniDir "E:/wamp/php"