首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MAMP 4的MySQL不能启动

MAMP 4的MySQL不能启动
EN

Stack Overflow用户
提问于 2016-09-05 18:34:36
回答 3查看 4.1K关注 0票数 5

我刚把我的MAMP3升级到MAMP4,MySQL不再启动了。

错误日志文件一遍又一遍地显示以下内容:

代码语言:javascript
复制
160905 11:22:17 mysqld_safe mysqld restarted
2016-09-05 11:22:17 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-09-05 11:22:17 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.28) starting as process 8122 ...
2016-09-05 11:22:17 8122 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql56/ is case insensitive
2016-09-05 11:22:17 8122 [Note] Plugin 'FEDERATED' is disabled.
2016-09-05 11:22:17 8122 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-09-05 11:22:17 8122 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-05 11:22:17 8122 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-05 11:22:17 8122 [Note] InnoDB: Memory barrier is not used
2016-09-05 11:22:17 8122 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-09-05 11:22:17 8122 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-05 11:22:17 8122 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-05 11:22:17 8122 [Note] InnoDB: Completed initialization of buffer pool
2016-09-05 11:22:17 8122 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-05 11:22:17 8122 [Note] InnoDB: The log sequence numbers 280599913118 and 280599913118 in ibdata files do not match the log sequence number 280599917593 in the ib_logfiles!
2016-09-05 11:22:17 8122 [Note] InnoDB: Database was not shutdown normally!
2016-09-05 11:22:17 8122 [Note] InnoDB: Starting crash recovery.
2016-09-05 11:22:17 8122 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-09-05 11:22:18 8122 [Note] InnoDB: Restoring possible half-written data pages
2016-09-05 11:22:18 8122 [Note] InnoDB: from the doublewrite buffer...
2016-09-05 11:22:18 8122 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-05 11:22:18 8122 [Note] InnoDB: 5.6.28 started; log sequence number 280599917593
2016-09-05 11:22:18 8122 [Note] RSA private key file not found: /Applications/MAMP/db/mysql56//private_key.pem. Some authentication plugins will not work.
2016-09-05 11:22:18 8122 [Note] RSA public key file not found: /Applications/MAMP/db/mysql56//public_key.pem. Some authentication plugins will not work.
2016-09-05 11:22:18 8122 [Note] Server hostname (bind-address): '*'; port: 8889
2016-09-05 11:22:18 8122 [Note] IPv6 is available.
2016-09-05 11:22:18 8122 [Note]   - '::' resolves to '::';
2016-09-05 11:22:18 8122 [Note] Server socket created on IP: '::'.
10:22:18 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68101 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fdf7b288400
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fff5eeb3870 thread_stack 0x40000
0   mysqld                              0x0000000101296688 my_print_stacktrace + 72
1   mysqld                              0x0000000100f5d9e8 handle_fatal_signal + 952
2   libsystem_platform.dylib            0x00007fff8ac9952a _sigtramp + 26
3   ???                                 0x00007fdf7b0b1170 0x0 + 140597818757488
4   mysqld                              0x0000000101181a13 _Z9get_fieldP11st_mem_rootP5Field + 99
5   mysqld                              0x0000000100f83cb1 _ZL8acl_loadP3THDP10TABLE_LIST + 1985
6   mysqld                              0x0000000100f82f5f _Z10acl_reloadP3THD + 1135
7   mysqld                              0x0000000100f82a55 _Z8acl_initb + 405
8   mysqld                              0x00000001011c0a9a _Z11mysqld_mainiPPc + 2298
9   mysqld                              0x0000000100d4db22 main + 34
10  libdyld.dylib                       0x00007fff8c2205ad start + 1

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 0
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

尝试手动启动它会产生以下错误:

代码语言:javascript
复制
$ ./Library/bin/mysqld
160905 11:24:33 [ERROR] Can't read from messagefile '/Applications/MAMP/Library/share/english/errmsg.sys'
160905 11:24:33 [Warning] Can't create test file /Applications/MAMP/db/mysql/Joachims-iMac.lower-test
160905 11:24:33 [Warning] Can't create test file /Applications/MAMP/db/mysql/Joachims-iMac.lower-test
./Library/bin/mysqld: Can't change dir to '/Applications/MAMP/db/mysql/' (Errcode: 2)
160905 11:24:33 [ERROR] Aborting

这让我认为这是由MAMP4的系统从MAMP3升级我的旧数据库引起的,这些数据库位于/ MAMP /db/mysql56/中,但升级过程本身崩溃,并显示以下错误:

代码语言:javascript
复制
Warning: Using a password on the command line interface can be insecure.
Looking for 'mysql' as: /Applications/MAMP/Library/bin/mysql
Looking for 'mysqlcheck' as: /Applications/MAMP/Library/bin/mysqlcheck
Error: Failed while fetching Server version! Could be due to unauthorized access.
FATAL ERROR: Upgrade failed

在bin文件夹中查看,我看到了一个脚本bin/checkMysql.sh,它执行以下操作:

代码语言:javascript
复制
$ /Applications/MAMP/Library/bin/mysqlcheck --all-databases --check --check-upgrade -u root -proot --socket=/Applications/MAMP/tmp/mysql/mysql.sock
Warning: Using a password on the command line interface can be insecure.
/Applications/MAMP/Library/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) when trying to connect

还有mysql_upgrade,它这样做:

代码语言:javascript
复制
$ /Applications/MAMP/Library/bin/mysql_upgrade -u root -proot --socket=/Applications/MAMP/tmp/mysql/mysql.sock --force --verbose
Warning: Using a password on the command line interface can be insecure.
Looking for 'mysql' as: /Applications/MAMP/Library/bin/mysql
Looking for 'mysqlcheck' as: /Applications/MAMP/Library/bin/mysqlcheck
Error: Failed while fetching Server version! Could be due to unauthorized access.
FATAL ERROR: Upgrade failed

当MAMP试图升级我的数据库时,我在MAMP的控制台输出中看到的错误消息就是这些错误消息的组合。

EN

回答 3

Stack Overflow用户

发布于 2016-11-17 23:43:45

修复它的方法是从MAMP >文件>编辑模板> MySQL使用的版本将以下代码行添加到my.cnf

代码语言:javascript
复制
innodb_force_recovery = 1
票数 3
EN

Stack Overflow用户

发布于 2017-11-29 07:50:45

我在从MAMP 3升级到MAMP 4时遇到了这个问题。除了你在这里看到的错误之外,你可能还会遇到这样的问题:

1045 - Access denied for user 'root'@'localhost' (using password: YES)

我相信所有的自动升级工具都假定您从未更改过根用户的默认根密码(密码: MySQL )。

我的解决方案是:

在终端中重新安装MAMP 4服务器,运行/Applications/MAMP/Library/bin/mysqladmin -u root -p password

  • You

  • 会提示您输入旧密码(而不是

),然后更新并确认新密码以恢复MAMP服务器,然后转到Tools > Upgrade MySQL revert your

  1. 升级后恢复您的密码,这样您现有的应用程序就不会崩溃。

你应该可以走了。

票数 3
EN

Stack Overflow用户

发布于 2016-09-05 20:53:48

看起来这和https://serverfault.com/questions/527422/mysql-upgrade-is-failing-with-no-real-reason-given是一样的问题

我不得不完全销毁整个系统,然后从头开始安装Mamp4,它工作得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39328747

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档