XAMPP安装配置教程(Windows)

来源:互联网 发布:mac在线安装系统 编辑:程序博客网 时间:2024/06/05 20:16

1.下载官方安装包

https://www.apachefriends.org/zh_cn/index.html

2.安装XAMPP

安装前关闭所有杀毒软件;
安装xampp自带mysql无需再安装;
安装到合适的安装路径;

3.启动XAMPP

这里写图片描述
如果顺利start Apache和MySQL都没问题恭喜你基本完成。
admin Mysql出现如下界面

这里写图片描述

4.配置mysql(基本完成)

配置xampp下的mysql的环境变量
参考此链接

5.如果安装XAMPP前已安装Mysql

出现如下端口冲突以及服务冲突

Problem detected!20:34:42  [mysql]   Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!20:34:42  [mysql]   MySQL WILL NOT start without the configured ports free!20:34:42  [mysql]   You need to uninstall/disable/reconfigure the blocking application20:34:42  [mysql]   or reconfigure MySQL and the Control Panel to listen on a different port

暴力方法:卸载之前的Mysql即可解决
其他方法:
这里写图片描述
config my.ini文件修改3306端口为其他端口解除端口冲突
这里写图片描述
打开计算机管理,关闭本机的Mysql服务
这里写图片描述
start xampp下的Mysql显示成功。

如果Mysql admin 出现#2002 - No such file or directory

解决phpmyadmin4.7.2安装的时候#2002 - No such file or directory — 服务器没有响应(或本地服务器的套接字没有正确设置)和mysqli_real_connect(): (HY000/2002): No such file or directory的问题。

   解决步骤:    找到根目录中 config.sample.inc.php 复制并重命名为 config.inc.php ,打开配置文件,找到 $cfg['Servers'][$i]['host'] = 'localhost'; 修改为 $cfg['Servers'][$i]['host'] = '127.0.0.1'; 即可。