2013-12-08 137 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来解决这个问题。因人而异。