2014-02-12 64 views
7

背景:我刚刚更新OS X给小牛,然后使用:rm -rf /usr/local删除brew(以及我通过自制软件安装的所有内容),并开始重新安装所有内容。mysql_install_db,错误:35,在Mac OS X上10.9.1

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. 

我总觉得完全失去了,并开始google搜索,我只喜欢这一点,这似乎是有帮助的:http://blog.tiagocarvalho.pt/2014/01/mac-os-x-mysql-problems.html

阅读后,仍然没有得到一个清晰的图片,但我的想法是(根据该职位): FIRST:ki ll -9(mysql PID)然后(我认为)我应该可以再次尝试mysql_install_db

所以我试过了,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出现了......

我不知道是怎么回事...任何提示?

而且,如果我做mysql.server stop,然后mysql.server status我会找到它重新启动......

回答

7

哎呀......我想我已经找到了......

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

我的意思是,我没有rm -rf /usr/local之前卸载它,所以我重新安装酿造和mysql后,它会自动启动,这将阻止我这样做mysql_install_db ...

顺便说一句,我发现这个链接是非常有帮助以及:How do you stop MySQL on a Mac OS install?

+1

嗯......我有这个完全相同的问题,但我似乎没有* * *在/ Library/LaunchAgents下的自制软件条目。如果我解决了这个问题,我会添加另一个答案,以防别人遇到同样的问题。 (PS - 我不知道为什么有人会低估这个问题,这是关于主题,详细的,并显示研究工作。) – LindaJeanne

+0

非常感谢你卸载命令...我不得不谋杀和重新安装MySQL,这个错误让我疯了 – caro

0

注:我已经安装使用自制软件。 mysql文件的位置可能取决于您使用的是brew还是包安装程序。

我首先尝试通过列出所有的mysql进程来终止进程 - ps aux | grep mysql。这没有用。发现它仍然重新启动,奇怪!

所以我列出了这里的文件 - >ls /usr/local/var/mysql。找到三个pid文件。摆脱了他们的 rm -rf <my-machine>.pid rm -rf <my-machine.local.pid> rm -rf mysqld_safe.pid

这有助于将它们关闭。

就你而言,这些文件可能位于/usr/local/mysql/var或其他地方。只是看看!

Goodluck!