简体   繁体   English

MAMP MySQL 无法启动 (Windows 10)

[英]MAMP MySQL won't start (Windows 10)

I see from reading around this is a very common problem and there are 2 recommended main solutions:我从阅读中了解到这是一个非常常见的问题,有两个推荐的主要解决方案:

  1. clear the temp files;清除临时文件; and
  2. check if another instance of MySQL is running.检查另一个 MySQL 实例是否正在运行。

Solution 1 - Clear files I have cleared ib_logfile0, ib_logfil1 and iddata1.解决方案 1 - 清除文件 我已经清除了 ib_logfile0、ib_logfil1 和 iddata1。 When I restart MAMP, it recreates these files but the server does not start.当我重新启动 MAMP 时,它会重新创建这些文件,但服务器没有启动。

Solution 2 - Close other instances of MySWL I am unable to find a way to check if MySQL is already running else where.解决方案 2 - 关闭 MySWL 的其他实例 我无法找到一种方法来检查 MySQL 是否已经在其他地方运行。 Reading around (inc MAMP help site), I should use Window task manager to search for "MySQLd" and close any instances that are running, however Win10 seems to have delete the search function from the task manager.阅读(包括 MAMP 帮助站点),我应该使用 Window 任务管理器来搜索“MySQLd”并关闭任何正在运行的实例,但是 Win10 似乎已经从任务管理器中删除了搜索功能。 A look through the processes did not show any though:浏览过程并没有显示任何内容:

screen shot of windows task manager Windows 任务管理器的屏幕截图

Next I have seen people adding "innodb_force_recovery = 1" to my.cnf file.接下来我看到有人在 my.cnf 文件中添加了“innodb_force_recovery = 1”。 I searched for my.cnf but couldn't find it.我搜索了 my.cnf 但找不到。 Instead I tried adding the line to C:\\MAMP\\conf\\mysql\\my.ini and I also tried adding "innodb_force_recovery = 2".相反,我尝试将该行添加到 C:\\MAMP\\conf\\mysql\\my.ini 并且我还尝试添加“innodb_force_recovery = 2”。 Neither worked.都没有工作。

I tried changing the port number that MySQL uses to 3307, that didnt work either.我尝试将 MySQL 使用的端口号更改为 3307,但也没有用。

Finally, I uninstalled and re-installed MAMP - didn't work.最后,我卸载并重新安装了 MAMP - 没有用。

The MySQL error log reads: MySQL 错误日志显示:

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. [警告] 不推荐使用带有隐式 DEFAULT 值的 TIMESTAMP。 Please use --explicit_defaults_for_timestamp server option (see documentation for more details).请使用 --explicit_defaults_for_timestamp 服务器选项(有关更多详细信息,请参阅文档)。

[Note] --secure-file-priv is set to NULL. [注意] --secure-file-priv 设置为 NULL。 Operations related to importing and exporting data are disabled数据导入导出相关操作被禁用

[Note] C:\\MAMP\\bin\\mysql\\bin\\mysqld.exe (mysqld 5.7.24-log) starting as process 9044 ... [注意] C:\\MAMP\\bin\\mysql\\bin\\mysqld.exe (mysqld 5.7.24-log) 从进程 9044 开始...

I think it would be useful if there is a way to check for instances of MySQL running via the command line, and then if they is one, how to close it from the command line.我认为如果有一种方法可以检查通过命令行运行的 MySQL 实例,然后如果它们是一个,那么如何从命令行关闭它会很有用。

Following steps fixed my issue以下步骤解决了我的问题

 1. Stop your MAMP Server.
 2. Find the db folder for mysql. In my case: C:\MAMP\db\mysql
 3. Rename the mysql-bin.index file to mysql-bin_old.index
 4. Start your MAMP Server

This question has been answered here: MySQL Server on MAMP-Windows Will Not Start此问题已在此处回答: MAMP-Windows 上的 MySQL 服务器将无法启动

The fix posted by this user apparently comes from MAMP support.该用户发布的修复显然来自 MAMP 支持。 My problem was identical to yours and it worked for me.我的问题和你的一样,对我有用。 The issue related to binary logging, which can be disabled in a configuration file.与二进制日志相关的问题,可以在配置文件中禁用。

Good luck.祝你好运。

This is what worked for me :这对我有用:

  1. Click on Start Servers in MAMP单击 MAMP 中的启动服务器
  2. Manually click on mysql.exe in MAMP installation folder C:\\MAMP\\bin\\mysql\\bin\\mysql.exe手动点击mysql.exe在MAMP安装文件夹C:\\ MAMP \\ BIN \\ mysql的\\ BIN \\的mysql.exe

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

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