2013-12-08 134 views
5

我剛剛在我的Mac上通過自制軟件安裝了MariaDB。在安裝結束時,我得到了以下錯誤:MariaDB自制軟件安裝錯誤

Warning: The post-install step did not complete successfully 
You can try again using `brew postinstall mariadb` 

如果我跑brew postinstall mariadb我得到:

==> /usr/local/Cellar/mariadb/5.5.34/bin/mysql_install_db --verbose --user=andrew --basedir=/usr/loca 
MariaDB is hosted on launchpad; You can find the latest source and 
email lists at http://launchpad.net/maria 

Please check all of the above before mailing us! And remember, if 
you do mail us, you should use the /usr/local/Cellar/mariadb/5.5.34/scripts/mysqlbug script! 

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting 

這是不是有幫助!我跟隨的教程告訴我運行unset TEMPDIR,然後mysql_install_db --user=mysql --basedir=$(brew --prefix mariadb);下面運行的結果:

/usr/local/opt/mariadb/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2) 
Fatal error in defaults handling. Program aborted 
chown: ./data: Operation not permitted 
Cannot change ownership of the database directories to the 'mysql' 
user. Check that you have the necessary permissions and try again. 

我懷疑問題有事情做與/usr/local/etc/my.cnf.d文件夾。我已經看到這在我嘗試過的一些事情中提到過,但它並不存在於我的機器上。我已經嘗試了其他教程中找到的幾個不同的mysql_install_db命令,但它們都拋出了(不同的)錯誤消息。

感謝您的幫助!

回答

16

進一步谷歌搜索的問題,我試圖手動創建一個/usr/local/etc/my.cnf.d和現在的mysql_install_db命令似乎工作正常。我不確定這是否是適當的解決方案,或者如果my.cnf.d不存在表明安裝存在更深層的問題,但由於事情似乎有效,我將標記爲已解決。

[更新]由於我的回答有點不確定,這是否是'正確'的解決方案,我只是想確認一個月後,一切仍然正常。

+1

感謝您的信息。我也不明白,但創建這個文件夾確實也解決了我的問題。 –

+2

這完全有效,但你需要小心,因爲'brew prune'會移除'/ usr/local/etc/my.cnf.d'。修復方法是在'brew prune'後手動替換它,只是想提醒一下。 –

15

只要打開配置文件在/usr/local/etc/my.cnf與你的編輯器並註釋掉以下行:

!includedir /usr/local/etc/my.cnf.d 
+0

這是我選擇的解決方案。在每次「brew prune」之後添加'/usr/local/etc/my.cnf.d'似乎太脆弱了,我很可能會忘記它將來的錯誤。評論這條線似乎是最好的解決方案。 –

1

你可能有一個孤立的配置文件。我能夠通過刪除舊的/usr/local/etc/my.cnf來解決這個問題。因人而異。