用php编写的web应用程序,需运行在php的web容器中,其中apache server是一个针对php web容器,它是apache下的开源项目。通常要运行一个web程序,我们还需要安装数据库软件,为了省去各种安装麻烦,选择了xampp一键安装。安装很简单(略),接着启动 xampp的控制器,界面如下:

xampp帮你打包安装了 mysql,appache,tomcat等等,确实生了不少气力。
接下来启动Apache,默认apache使用80端口作为监听端口,如果80端口被其他程序例如IIS占用。要么改iis的默认端口(iis默认端口号也是80),要么去修改apache,修改apache端口要去xampp的安装目录中找到 ../apache/conf/http.conf,将端口80,修改其他的端口,一共有两处需要修改。




然后重新启动appche,点击 admin按钮进入管理界面看看?


怎么进入的是微软的iis web服务器?很简单,你需要自己将url地址后跟上刚刚修改的端口号。这样就看到了。


接下来,我们启动mysql。然后在xampp的管理界面里 通过phpmyadmin链接,进入mysql。mysql的管理界面的底部红色醒目的提示您
mysql root帐号密码为空,为了安全考虑,请给root帐号设置密码。
我们点击‘用户’标签页看到如下帐号:


root帐号密码默认都是空的,此图看到的是修改后的效果。修改root帐号的密码,首先要选中左侧的mysql数据库,然后在sql标签页里执行sql。
update user set password=password('wind') where User='root' ,这样就批量一次修改了图中的3条记录。
刷新页面,mysql无法访问了。。提示验证错误,拒绝登录,最大的坑来了。上网搜索了大量的中文资料,需要去xampp安装目录:xampp\phpMyAdmin\libraries下找到 config.default.php ,将下图中的密码改成之前在mysql里设定的root帐号的密码。


以为大功告成了,刷一刷页面,还是登录不了,急呀,在这上面耗费了好多时间。。。最后终于在phpmyadmin的官方文档中找到答案。


默认phpmyadmin使用的是config.default.php的配置内容,但是同样的配置在config.inc.php文件中也存在,那么会覆盖掉默认的配置。
于是乎找到该文件打开一看。


这里压根就是一个空值,改成mysql root帐号的密码,保存,刷新页面,phpmyadmin管理界面终于工作正常了。