xampp MySQL 不启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18177148/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xampp MySQL does not start
提问by tomasz74
I installed Xampp on Windows 7 32-bit. When I try to start MySql in XAMPP control panel (v3.2.1) I have the following message and MySql does not start.
我在 Windows 7 32 位上安装了 Xampp。当我尝试在 XAMPP 控制面板 (v3.2.1) 中启动 MySql 时,我收到以下消息并且 MySql 没有启动。
23:02:03 [mysql] Problem detected!
23:02:03 [mysql] Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL"!
23:02:03 [mysql] MySQL WILL NOT start without the configured ports free!
23:02:03 [mysql] You need to uninstall/disable/reconfigure the blocking application
23:02:03 [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
23:02:03 [mysql] Attempting to start MySQL service...
A similar problem was reported herebut there is no working answer. When I try to install with MySql disabled, the result is that I even don't have an option even to try to run it.
这里报告了类似的问题,但没有有效的答案。当我尝试在禁用 MySql 的情况下安装时,结果是我什至没有选择尝试运行它。
I am new to Xampp and don't know where and what to look for to solve the issue
我是 Xampp 的新手,不知道在何处寻找解决问题的方法
I need to run Apache and MySql with Php.
我需要用 PHP 运行 Apache 和 MySql。
回答by DevlshOne
You already have a version of mySQL installed on this machine that is using port 3306. Go into the most recent my.ini
file and change the port to 3307
. Restart the mySQL service and see if it comes up.
您已经在这台机器上安装了一个使用端口 3306 的 mySQL 版本。进入最新的my.ini
文件并将端口更改为3307
. 重启mySQL服务,看看是否出现。
You also need to change port 3306 to 3307 in xampp\php\php.ini
您还需要将 xampp\php\php.ini 中的端口 3306 更改为 3307
回答by John Hogan
You have two versions of mysql using the same port. 3306. Change the port.
您有两个版本的 mysql 使用相同的端口。3306.更改端口。
How to change the mysql port for xampp?
如何更改 xampp 的 mysql 端口?
- Stop the xampp server, if it is already running.
- Edit the value to "port" in xampp/mysql/bin/my.ini
- 停止 xampp 服务器,如果它已经在运行。
- 在 xampp/mysql/bin/my.ini 中将值编辑为“端口”
Code:
代码:
Password = your_password
port = 3306 ---> 3307
socket = "/ xampp / mysql / mysql.sock"
and here also
还有这里
Code:
代码:
The MySQL server
[ mysqld ]
port = 3306 ---> 3307
socket = "/ xampp / mysql / mysql.sock"
2. Start mysql service
回答by Gideon Mwangi
I found out that re-installing Xampp as an administrator and running it as an Administrator worked.
我发现以管理员身份重新安装 Xampp 并以管理员身份运行它是有效的。
回答by Alejandro
If there are two instances of MySql it's normal that it gives such an error if they both run at the same time. If you really need 2 servers, you must change the listening port of one of them, or if you don't it's probably better to simply uninstall one of them. This is so regarless of MySql itself, because two programs cannot listen on the same port at the same time.
如果有两个 MySql 实例,如果它们同时运行,它会给出这样的错误是正常的。如果您确实需要两台服务器,则必须更改其中一台的侦听端口,否则最好卸载其中一台。这与MySql本身无关,因为两个程序不能同时监听同一个端口。
回答by DBS
回答by jcansell
Google Brings me here. The favourite answers don't help me. I've now solved it, so maybe this will help someone else. Problem: after UPDATE of XAMPP to a new version I get the message "MySQL WILL NOT start without the configured ports free!".
谷歌把我带到这里。最喜欢的答案对我没有帮助。我现在已经解决了,所以也许这会帮助别人。问题:在将 XAMPP 更新到新版本后,我收到消息“如果配置的端口没有空闲,MySQL 将不会启动!”。
However, I only have 1 instance of mysqld running.
但是,我只有 1 个 mysqld 实例在运行。
It seems that the control panel is not as clever as it looks. As far as I can tell, the single instance of mysqld is the new one i've just updated to, but running as a 'service'. The control panel then tries to start it, and instead of realising its already running, It assumes its another service and reports the error.
似乎控制面板并不像看起来那么聪明。据我所知,mysqld 的单个实例是我刚刚更新到的新实例,但作为“服务”运行。控制面板然后尝试启动它,而不是意识到它已经在运行,而是假设它的另一个服务并报告错误。
Probable cause: The uninstaller failed to remove the autostart property from the mysql service, so the new instal picked it up.
可能的原因:卸载程序未能从 mysql 服务中删除 autostart 属性,因此新安装程序将其选中。
Solution:
open the Xammpp Control Panel and click on the Services Button on the right. This will open the services control panel.
Look for mysqld in the list of running processes, right-click it to get the properties and change the startup type to "Manual".
you might as well do the same for Apache2 while you're here.
Apply changes and Close the services control panel.
解决方法:
打开Xammpp控制面板,点击右侧的服务按钮。这将打开服务控制面板。在正在运行的进程列表中查找mysqld,右键单击它以获取属性并将启动类型更改为“手动”。当你在这里时,你也可以为 Apache2 做同样的事情。应用更改并关闭服务控制面板。
Now click the Config Button on xampp control panel, uncheck The Mysql (and Apache) Autostart features.
现在单击 xampp 控制面板上的配置按钮,取消选中 Mysql(和 Apache)自动启动功能。
Reboot the machine. You should now be able to start / stop Mysql & Apache without any error messages. If this works, use the Xampp Control panel as usual to start/stop add service or add autostart as normal. No need to mess with any ports or config files.
重新启动机器。您现在应该能够启动/停止 Mysql 和 Apache,而不会出现任何错误消息。如果这有效,请像往常一样使用 Xampp 控制面板来启动/停止添加服务或正常添加自动启动。无需弄乱任何端口或配置文件。
回答by Saeed
The is a simple and faster way to solve the problem.
这是解决问题的一种简单快捷的方法。
You don't need to open a services
or write any cmd
code just follow my steps:
您无需打开services
或编写任何cmd
代码,只需按照我的步骤操作即可:
from
XAMPP control
panel clickExplorer
buttonfrom directory find
mysql_stop.bat
file and run it.
从
XAMPP control
面板单击Explorer
按钮从目录中找到
mysql_stop.bat
文件并运行它。
Thats all!! super easy.
就这样!!超级容易。
Refresh your netstat
list, you will see that it has gone.
刷新你的netstat
列表,你会看到它已经消失了。
please make it as best answer.
请把它作为最佳答案。
回答by zeeawan
Same issue on macOS and got it fixed by running the same installer again.
macOS 上的相同问题并通过再次运行相同的安装程序来修复它。
Whereas I COULD NOTget it fixed by
虽然我 不能把它固定的
- Changing port
- Rebooting XAMPP
- Restarting system
- 更改端口
- 重启 XAMPP
- 重启系统
Note:Make sure to select 'XAMPP Core Files'component while running the installer as by default it is not selected.
注意:确保在运行安装程序时选择“XAMPP Core Files”组件,因为默认情况下它没有被选中。
Though re-running the installer is not smart option when one has to do it every now and then. My installer is xampp-osx-7.0.13-1-installer.dmg
尽管重新运行安装程序并不是明智的选择,但必须时不时地这样做。我的安装程序是 xampp-osx-7.0.13-1-installer.dmg
Update:I've got my MAMPworking with this simple solution here. So, same should work for XAMPP.
更新:我的MAMP在这里使用了这个简单的解决方案。所以,同样应该适用于XAMPP。
回答by Sergio Gandrus
If you have previously installed MySQL Workbench the problem is that another MySQL instance is running at 3306 port.
如果您之前安装过 MySQL Workbench,问题是另一个 MySQL 实例正在 3306 端口上运行。
So uninstall MySQL and XAMPP and after that, reinstall only XAMPP.
因此,卸载 MySQL 和 XAMPP,然后仅重新安装 XAMPP。
This worked for me.
这对我有用。