在Mac OS X 10.9.1上为mysql_install_db,错误:35 [英] mysql_install_db, error: 35, on a Mac OS X 10.9.1

查看:91
本文介绍了在Mac OS X 10.9.1上为mysql_install_db,错误:35的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我刚刚将OS X更新为Mavericks,然后使用:rm -rf /usr/local删除了brew(以及通过自制软件安装的所有内容),并开始重新安装所有内容.

Background: I've just updated OS X to Mavericks, then I removed brew(and everything I installed via homebrew) using:rm -rf /usr/local and began to reinstall everything.

brew install mysql之后,我尝试了:

unset TMPDIR
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

但是我得到了

mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Installing MySQL system tables...2014-02-12 16:43:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-02-12 16:43:45 2358 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-02-12 16:43:45 2358 [Note] InnoDB: The InnoDB memory heap is disabled
2014-02-12 16:43:45 2358 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-02-12 16:43:45 2358 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-02-12 16:43:45 2358 [Note] InnoDB: Using CPU crc32 instructions
2014-02-12 16:43:45 2358 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-02-12 16:43:45 2358 [Note] InnoDB: Completed initialization of buffer pool
2014-02-12 16:43:45 2358 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 35
2014-02-12 16:43:45 2358 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2014-02-12 16:43:45 2358 [Note] InnoDB: Retrying to lock the first data file
2014-02-12 16:43:46 2358 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 35
2014-02-12 16:43:46 2358 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

我完全迷路了,开始谷歌搜索,我只是喜欢这个,这似乎很有帮助:

And I got totally lost, and started googling, I only fond this, which seems to be helpful: http://blog.tiagocarvalho.pt/2014/01/mac-os-x-mysql-problems.html

在阅读了该帖子之后,仍然没有清晰的画面,但是在我看来(根据该帖子)是: 首先:杀死-9(mysql PID),然后(我认为)我应该能够再次尝试.

After read that post, still did not get a clear picture, but what in my mind was to (according to that post): FIRST: kill -9 (the mysql PID) and THEN (I think) I should be able to try mysql_install_db again.

所以我尝试了,ps xua | grep mysql显示:

4683   0.0  0.0  2442000    624 s001  S+    7:39下午   0:00.01 grep mysql
4547   0.0  3.3  3080024  68276   ??  S     7:18下午   0:00.98 /usr/local/Cellar/mysql/5.6.16/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.16 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.16/lib/plugin --log-error=/usr/local/var/mysql/UU.local.err --pid-file=/usr/local/var/mysql/UU.local.pid
4476   0.0  0.0  2436436    808   ??  S     7:18下午   0:00.02 /bin/sh /usr/local/bin/mysqld_safe

但是,在kill -9 4547kill -9 4476之后,它们又出现了,带有两个不同的PID ...

BUT, after kill -9 4547 and kill -9 4476, they showed up again with two different PID...

我不知道发生了什么...任何提示吗?

I don't know what is going on... Any hint?

另外,如果我执行mysql.server stop,那么mysql.server status我会发现它会重新启动...

ALSO, if I do mysql.server stop, then mysql.server status I'll find it restarts...

推荐答案

糟糕...我想我已经找到了...

Oops... I think I've found it...

我只需要launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist.

我的意思是,我没有在rm -rf /usr/local之前卸载它,所以在我重新安装brew和mysql之后,它将自动启动,这阻止了我执行mysql_install_db ...

I mean, I did not unload it before rm -rf /usr/local, so after I reinstall brew and mysql, it will automatically starts, which prevents me from doing mysql_install_db...

顺便说一句,我发现此链接也非常有用:

btw, I found this link very helpful as well: How do you stop MySQL on a Mac OS install?

这篇关于在Mac OS X 10.9.1上为mysql_install_db,错误:35的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆