ice*_*ceX 7 mysql osx-mavericks
背景:我刚刚将OS X更新为Mavericks,然后我使用以下方法删除了brew(以及我通过自制软件rm -rf /usr/local
安装的所有内容),并开始重新安装所有内容.
之后brew install mysql
,我尝试过:
unset TMPDIR
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Run Code Online (Sandbox Code Playgroud)
但我得到了:
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.
Run Code Online (Sandbox Code Playgroud)
我完全迷失了,并开始谷歌搜索,我只喜欢这个,这似乎是有帮助的:http://blog.tiagocarvalho.pt/2014/01/mac-os-x-mysql-problems.html
读完那篇文章之后,仍然没有得到一个清晰的图片,但在我的脑海里是什么(根据那篇文章):FIRST:kill -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
Run Code Online (Sandbox Code Playgroud)
但之后kill -9 4547
和kill -9 4476
,他们再次显示了两种不同的PID ...
我不知道发生了什么......有什么提示吗?
如果我这样做mysql.server stop
,那么mysql.server status
我会发现它重新启动......
哎呀......我想我找到了......
我只需要launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
.
我的意思是,我之前没有卸载它rm -rf /usr/local
,所以在我重新安装brew和mysql之后,它会自动启动,这阻止我做mysql_install_db
...
顺便说一句,我发现这个链接也非常有用:你如何在Mac OS安装上停止MySQL?