MySQL服务器无法通过Mac OS上的MAMP运行

时间:2018-10-10 14:22:41

标签: mysql macos mamp

我将MAMP PRO 3.5.2版本升级到了第5个版本,并且MySQL启动失败。

我通过killall -9 mysqld杀死了mysqld进程,清理了ib_logfile*之类的日志文件,并尝试使用innodb recovery进行操作。

我得到的日志如下:

2018-10-10T14:16:12.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'. 2018-10-10T14:16:12.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57 2018-10-10T14:16:13.043096Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 2018-10-10T14:16:13.051110Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.23) starting as process 5538 ... 2018-10-10T14:16:13.064223Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive 2018-10-10T14:16:13.074890Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-10-10T14:16:13.074926Z 0 [Note] InnoDB: Uses event mutexes 2018-10-10T14:16:13.074936Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2018-10-10T14:16:13.074943Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-10-10T14:16:13.074972Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB 2018-10-10T14:16:13.079521Z 0 [Note] InnoDB: Number of pools: 1 2018-10-10T14:16:13.084840Z 0 [Note] InnoDB: Using CPU crc32 instructions 2018-10-10T14:16:13.089357Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2018-10-10T14:16:13.114376Z 0 [Note] InnoDB: Completed initialization of buffer pool 2018-10-10T14:16:13.140491Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2018-10-10T14:16:13.145746Z 0 [ERROR] InnoDB: Trying to access page number 527111 in space 0, space name innodb_system, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server. 2018-10-10T14:16:13.145772Z 0 [ERROR] InnoDB: Server exits. 2018-10-10T14:16:13.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

在我开始考虑卸载并重新安装MAMP时,希望能获得任何提示,这意味着我将失去一些本地DB安装。

谢谢!

1 个答案:

答案 0 :(得分:1)

因此问题得以解决,MySQL通过MAMP 5.1在本地运行。

在确定以下my.cnf设置中出了什么问题时,应用了

  • 增加了innodb_buffer_pool_size的值:innodb_buffer_pool_size = 1024M
  • 强制恢复模式处于innodb_force_recovery = 1

这会导致问题中提到的错误:

[ERROR] InnoDB: Trying to access page number 527111 in space 0, space name innodb_system, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.

此时,ibdata目录和路径的默认设置未在my.cnf内注释:

innodb_data_home_dir = "/Library/Application Support/appsolute/MAMP PRO/db/mysql57"

innodb_data_file_path = ibdata1:10M:autoextend

innodb_log_group_home_dir = "/Library/Application Support/appsolute/MAMP PRO/db/mysql57"

报告了错误日志,记录了访问限制(我前面没有确切的句子),在这里丢失了一些,作为一种猜测,我将文件夹/Library/Application Support/appsolute/MAMP PRO/db/mysql57的权限扩展到了当前的权限用户。

那并没有改变日志。关于ibdata的错误路径的错误仍然存​​在。

最终,将文件夹mysql(完整版本的ibdata(〜40Gb)重命名为mysql57的帮助。

在安装MAMP 5.1之后,/Library/Application Support/appsolute/MAMP PRO/db/中具有以下文件夹结构:

-- mysql

-- mysql56_TIMESTAMP

-- mysql57

具有相同的文件结构,但对内容的进一步比较显示mysql中文件的完整版本,因此将其重命名,并在MAMP正常工作后进行测试后删除了所有文件夹,没有它们。

因此,现在mysql中只有一个/Library/Application Support/appsolute/MAMP PRO/db/文件夹。我在该过程中自定义的my.cnf内部的设置已回滚。