简体   繁体   English

MySQL 不会在 XAMPP 服务器上启动

[英]MySQL won't start on XAMPP server

I have a problem with my XAMPP server.我的 XAMPP 服务器有问题。 I can start Apache, FileZilla, and every thing else without problems, but when I try to start MySQL, it just says我可以毫无问题地启动 Apache、FileZilla 和其他所有东西,但是当我尝试启动 MySQL 时,它只是说

Attempting to start MySQL service...正在尝试启动 MySQL 服务...

and it stays like that forever, like if it was frozen or something.它永远保持这样,就像它被冻结了一样。

Any ideas how to fix it?任何想法如何解决它?

Check the log files for MySQL.检查 MySQL 的日志文件。 You will find them in this directory: C:\\xampp\\mysql\\data (assuming standard install location of xampp)您将在此目录中找到它们:C:\\xampp\\mysql\\data(假设 xampp 的标准安装位置)

Also check if no other program or service uses the default MySql port.还要检查是否没有其他程序或服务使用默认的 MySql 端口。 You can do this by using this command:您可以使用以下命令执行此操作:

netstat -an | findstr "3306"

If anything shows up the default mysql port is in use.如果有任何显示,则默认 mysql 端口正在使用中。

I fetch the problem to start xampp services "mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files"我获取问题以启动 xampp 服务“mysqld.exe:Aria 恢复失败。请在所有 Aria 表上运行 aria_chk -r 并删除所有 aria_log.######## 文件”

I delete all area_log files form xampp\\mysql\\data我从 xampp\\mysql\\data 中删除所有 area_log 文件

after that I restart XAMPP than it works.之后,我重新启动 XAMPP 并使其正常工作。

Thanks谢谢

在 Windows 中,您应该去:开始 > 运行 > services.msc > Apache 2.4 > 属性 > 启动模式 > 自动 > 应用 > 开始 > 确定 > [与 MySQL 相同]

I was not able to start Mysql on xampp .我无法在xampp上启动Mysql Error message was:-错误信息是:-

Aria recovery failed.咏叹调恢复失败。 Please run aria_chk -r on all Aria tables and delete all aria_log.######## files.请在所有 Aria 表上运行 aria_chk -r 并删除所有 aria_log.######## 文件。 Plugin 'Aria' init function returned error.插件“Aria”初始化函数返回错误。 Plugin 'Aria' registration as a STORAGE ENGINE failed.插件“Aria”注册为存储引擎失败。 Plugin 'FEEDBACK' is disabled.插件“反馈”被禁用。 Aria engine is not enabled or did not start. Aria 引擎未启用或未启动。 The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables.必须启用 Aria 引擎才能继续,因为 mysqld 是使用 --with-aria-tmp-tables 配置的。 Aborting.中止。

Just to go xampp/mysql/data and delete or remove the file related to aria_log and restart your xampp server.只需转到xampp/mysql/data并删除或删除与aria_log相关的文件并重新启动您的xampp服务器。 Worked fine for me.对我来说效果很好。

解决在活动监视器中停止 mysql 进程然后从 xampp UI 内重新启动 mysql 服务器的问题。

Go to the error log and check.转到错误日志并检查。 For me I got this error message:对我来说,我收到此错误消息:

InnoDB: Error: could not open single-table tablespace file .\\mysql\\innodb_index_stats.ibd InnoDB: We do not continue the crash recovery, because the table may become InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. InnoDB: Error: could not open single-table tablespace file .\\mysql\\innodb_index_stats.ibd InnoDB: 我们不继续崩溃恢复,因为表可能会变成 InnoDB: 如果我们不能将 InnoDB 日志中的日志记录应用到它. InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions. InnoDB: 解决问题并启动mysqld: InnoDB: 1) 如果文件存在权限问题,mysqld 无法打开文件 InnoDB: 打开文件,修改权限。 InnoDB: 2) If the table is not needed, or you can restore it from a backup, InnoDB: then you can remove the .ibd file, and InnoDB will do a normal InnoDB: crash recovery and ignore that table. InnoDB:2)如果不需要该表,或者您可以从备份中恢复它,InnoDB:那么您可以删除 .ibd 文件,InnoDB 将执行正常的 InnoDB:崩溃恢复并忽略该表。 InnoDB: 3) If the file system or the disk is broken, and you cannot remove InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to continue crash recovery here. InnoDB: 3) 如果文件系统或者磁盘坏了,无法删除InnoDB:.ibd文件,可以在my.cnf中设置innodb_force_recovery > 0 InnoDB: 在这里强制InnoDB继续崩溃恢复。

So what I did was I went to the mysql folder and deleted the data1idb file.所以我所做的是我去了mysql文件夹并删除了data1idb文件。 After that it worked fine.之后它工作得很好。 The problem started when I installed Drupal.当我安装 Drupal 时,问题就开始了。

Perform履行

which mysql.server

sudo path/to/mysql.server start

This should work on *nix OS这应该适用于 *nix 操作系统

eg sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start for mac osx例如sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start for mac osx

In The xampp folder you should find the start mysql batch file.在 xampp 文件夹中,您应该找到启动 mysql 批处理文件。 Run it, The firewall might ask if you want to allow it through ( So check your firewall if it lets mysqld.exe through )运行它,防火墙可能会询问您是否允许它通过(因此请检查您的防火墙是否允许 mysqld.exe 通过)

OP did not provide enough information, however this (and other errors) can be caused by the default MySQL port (3306) being used. OP 没有提供足够的信息,但是这个(和其他错误)可能是由正在使用的默认 MySQL 端口 (3306) 引起的。 If this is the case, you can solve it like this:如果是这种情况,您可以这样解决:

Go to:去:

XAMPP Control Panel -> MySQL: "Config" button -> my.ini
Change the port number from 3306 to a different valid port number. 将端口号从 3306 更改为不同的有效端口号。 I just used 3307. 我刚用的3307。

You can find out more information about your problem by looking at the error log file. 您可以通过查看错误日志文件来了解有关您的问题的更多信息。 This is found here: 这是在这里找到:
 XAMPP Control Panel -> MySQL: "Logs" button -> mysql_error.log XAMPP 控制面板 -> MySQL:“日志”按钮 -> mysql_error.log

运行位于 Xampp 根目录中的“setup_xampp.bat”文件对我有用。

Though this is late, I'm sure it would help someone in future.虽然这已经很晚了,但我相信它会对将来的某人有所帮助。

  1. First run which mysql.server to know where mysql is located on your machine.首先运行which mysql.server以了解 mysql 在您的机器上的位置。 After then run sudo /usr/local/bin/mysql.server stop to be sure that no other mysql process is running.然后运行sudo /usr/local/bin/mysql.server stop以确保没有其他 mysql 进程正在运行。 If no other process is running, you would definitely get an error saying MySQL server PID file could not be found!如果没有其他进程正在运行,您肯定会收到一条错误消息,说找不到 MySQL 服务器 PID 文件! . . That's fine.没关系。

  2. After then run sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start to start Xampp's mysql server.然后运行sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start启动 Xampp 的 mysql 服务器。 When you go to the Xampp GUI, you should see that mysql status as running .当您转到 Xampp GUI 时,您应该看到 mysql 状态为running

Please note that this is for OS X users.请注意,这是针对 OS X 用户的。

I face same issue.我面临同样的问题。 I installed xampp in D drive.我在 D 盘安装了 xampp。

I uninstall and install setup as run as administrator.我以管理员身份卸载并安装安装程序。 Again face same issue.再次面临同样的问题。

I searched and try lot of suggestion but no luck.我搜索并尝试了很多建议,但没有运气。

I solve the problem by right click on xampp and open as Administrator and xampp start working fine.我通过右键单击 xampp 并以管理员身份打开来解决问题,xampp 开始正常工作。

I was not able to start MySQL service.我无法启动 MySQL 服务。 When I checked mysql log it said:当我检查 mysql 日志时,它说:

[ERROR] mysqld: File 'C:\xampp\mysql\data\aria_log_control' not found (Errcode: 13 "Permission denied")
[ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file 'C:\xampp\mysql\data\aria_log_control'

I checked suggested location in the log and file was present.我检查了日志中的建议位置并且文件存在。

I found I was doing silly mistake, Since UAC is activated in my PC, I had to start XAMPP using "Run As Administrator".我发现我犯了一个愚蠢的错误,由于在我的 PC 中激活了 UAC,我不得不使用“以管理员身份运行”启动 XAMPP。

It worked fine for me.它对我来说很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM