mySQL和XAMPP的端口冲突

car*_*vdm 5 php mysql apache xampp

我一直在使用XAMPP/Apache,最近决定安装MySQL.然而,它们似乎是相互矛盾的.MySQL似乎更喜欢它,它运行正常,但XAMPP/Apache在尝试启动Apache时给我这个错误消息:

03:07:32 AM  [Apache]   Attempting to start Apache app...
03:07:33 AM  [Apache]   Status change detected: running
03:07:33 AM  [Apache]   Status change detected: stopped
03:07:33 AM  [Apache]   Error: Apache shutdown unexpectedly.
03:07:33 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
03:07:33 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
03:07:33 AM  [Apache]   Press the Logs button to view error logs and check
03:07:33 AM  [Apache]   the Windows Event Viewer for more clues
03:07:33 AM  [Apache]   If you need more help, copy and post this
03:07:33 AM  [Apache]   entire log window on the forums
Run Code Online (Sandbox Code Playgroud)

我尝试按照这里的说明操作:http: //www.coco-concrete-concise.com/web-tools/how-to-change-the-apache-port-in-xampp

我已经尝试更改文件:xampp/apache/conf中的httpd.conf

将"Listen 80"更改为各种内容,并在重新启动应用程序后发生了相同的错误消息.

非常感谢在这件事上的任何帮助.我不想仅仅为了使用XAMPP而删除mySQL,但如果它们无法同时运行,我将不会这样做.

提前致谢.

编辑:

我相信它与MySQL相冲突的原因是:

03:26:51 AM  [mysql]    Problem detected!
03:26:51 AM  [mysql]    Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56"!
03:26:51 AM  [mysql]    MySQL WILL NOT start without the configured ports free!
03:26:51 AM  [mysql]    You need to uninstall/disable/reconfigure the blocking application
03:26:51 AM  [mysql]    or reconfigure MySQL and the Control Panel to listen on a different port
Run Code Online (Sandbox Code Playgroud)

我在使用XAMPP/Apache暂时禁用mySQL时遇到了一些困难.有没有办法改变端口,以便它们可以共存?

编辑2:

试图按照这里的说明:http: //silentlyrun.blogspot.com.au/2013/02/how-to-change-apache-n-mysql-port-for.html

之后我遇到以下错误消息:

09:13:22 AM  [main]     Initializing Modules
09:13:22 AM  [Apache]   Problem detected!
09:13:22 AM  [Apache]   Port 80 in use by "Unable to open process" with PID 4084!
09:13:22 AM  [Apache]   Apache WILL NOT start without the configured ports free!
09:13:22 AM  [Apache]   You need to uninstall/disable/reconfigure the blocking application
09:13:22 AM  [Apache]   or reconfigure Apache and the Control Panel to listen on a different port
09:13:22 AM  [Apache]   Problem detected!
09:13:22 AM  [Apache]   Port 443 in use by "Unable to open process" with PID 4084!
09:13:22 AM  [Apache]   Apache WILL NOT start without the configured ports free!
09:13:22 AM  [Apache]   You need to uninstall/disable/reconfigure the blocking application
09:13:22 AM  [Apache]   or reconfigure Apache and the Control Panel to listen on a different port
Run Code Online (Sandbox Code Playgroud)

有了这些说明,新端口应该是一样的吗?我假设是因为他们都是80岁.

4. Search the string "Listen" in the file.
5. Replace port number 80 to any other unused port number.
6. Search for "ServerName" in the file.
7. Replace port number 80 to any other unused port number in the ServerName.
Run Code Online (Sandbox Code Playgroud)

编辑3:

由于我不知道的原因,从上面的silentntlyrun.blogspot链接重新安装和端口更改后,XAMPP/MySQL没有问题.但是XAMPP/Apache仍然存在问题:

09:32:14 AM  [Apache]   Error: Apache shutdown unexpectedly.
09:32:14 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
09:32:14 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
09:32:14 AM  [Apache]   Press the Logs button to view error logs and check
09:32:14 AM  [Apache]   the Windows Event Viewer for more clues
09:32:14 AM  [Apache]   If you need more help, copy and post this
09:32:14 AM  [Apache]   entire log window on the forums
Run Code Online (Sandbox Code Playgroud)

Ash*_*ish 14

要在已经运行另一个MySQL服务器时解决MySQL端口和服务冲突,您需要执行以下步骤: -

1)关闭XAMPP服务器

2)打开文件C:\ xampp\mysql\bin\my.ini(C:是默认的XAMPP安装)

3)用3307替换端口号3306

#password = your_password

port = 3307

socket ="C:/xampp/mysql/mysql.sock"

#MySQL服务器

的[mysqld]

port = 3307

4)保存文件并打开XAMPP控制面板

5)在XAMPP控制面板中单击配置 > 服务和端口设置

6)转到MySQL标签

7)将服务名称mysql更改为mysqlxampp,将主端口3306更改为3307

8)单击"保存",然后单击"保存"并关闭XAMPP

9)再次运行XAMPP,您将能够启动MySQL服务器

您可能还会遇到phpMyAdmin的问题,您可以添加一行

$ cfg ['Servers'] [$ i] ['port'] ='3307';

在phpMyAdmin根目录下的config.inc.php文件中.


小智 4


如果你单独安装了MySQL并且还运行了XAMPP的MySQL,那么你就会遇到这个问题。冲突是针对端口 3306 而不是针对端口 80。我建议您遵循此处提到的准则:

http://silentlyrun.blogspot.com.au/2013/02/how-to-change-apache-n-mysql-port-for.html

当我单独安装 MySQL 并将其作为 XAMPP 的一部分时,这对我有用。