2014-02-12 125 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!