2014-05-24 248 views
1

我已經從here下載了mysql-5.6.17-osx10.7-x86.tar.gz。現在我已經有了一個充滿MySQL相關文件的文件夾。麻煩的是,我不知道如何安裝MySQL。我試着執行mysql_install_db,但結果卻是:安裝MySQL安裝

Last login: Sat May 24 10:45:08 on ttys000 
host237-40-dynamic:~ michelegorini$ /Users/michelegorini/Downloads/mysql-5.6.17-osx10.7-x86/scripts/mysql_install_db ; exit; 
FATAL ERROR: Could not find ./bin/my_print_defaults 

If you compiled from source, you need to run 'make install' to 
copy the software into the correct location ready for operation. 

If you are using a binary release, you must either be at the top 
level of the extracted archive, or pass the --basedir option 
pointing to that location. 

logout 

[Process completed] 

那麼,我該怎麼辦?

更新: 考慮答案進去,我試過的東西,這個結果:

Last login: Sat May 24 10:45:08 on ttys000 
host237-40-dynamic:Hakka_ michelegorini$ $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" 
curl: (22) The requested URL returned error: 400 
-bash: $: command not found 
host237-40-dynamic:Hakka_ michelegorini$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" && brew install git && 
> brew update 
curl: (22) The requested URL returned error: 400 
-bash: brew: command not found 
host237-40-dynamic:Hakka_ michelegorini$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" && brew install git && brew update && brew install mysql 
curl: (22) The requested URL returned error: 400 
-bash: brew: command not found 
host237-40-dynamic:Hakka_ michelegorini$ 

現在怎麼辦?

+2

關於「我已經使用mac for linux完成了該操作,因爲我在mac上,最終找到了這個存檔」? – user3670025

+0

閱讀:http://blog.ijun.org/2011/02/mysqlinstalldb-fatal-error-could-not.html –

+0

我試過'/ usr/local/bin/mysql_install_db --basedir =/usr/local'並且得到了'致命錯誤:找不到my-default.cnf 如果你從源代碼編譯,你需要運行'make install'到 將軟件複製到正確的位置以備操作。 如果您使用的是二進制版本,您必須位於解壓縮歸檔的頂層 級別,或者傳遞指向該位置的--basedir選項 .'但是,my_default.cnf文件不適用於我文件系統。 – user3670025

回答

1

自制軟件包管理器可以消除在您的計算機上安裝軟件包時的痛苦。

Here's how to install mysql on a mac

在一行命令:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" && brew install git && brew update && brew install mysql 
+0

這樣做的結果是終端被'>'卡住了,並在那一刻輸入'brew update'導致curl:(22)請求的URL返回錯誤:400 -bash:brew:command not found'。 – user3670025

1

如果我只是走了一個鏈接。此外,我發現this video,目前已解決了我的問題,據我可以告訴。爲了進一步閱讀,如果想要將SQL與Java接口,可能需要使用this video