Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql_install_db gives FATAL ERROR: Could not find my-default.cnf

I've download MySQL and I'm trying to setup the MySQL grant tables, but when I type:

scripts/mysql_install_db --basedir=/usr/local

I get the error above.

I'm not sure how to fix it, as my-default.cnf is in the support_files directory and I believe I'm setting the basedir correctly.

(This is on mac btw)

like image 819
Josh Antonson Avatar asked Mar 16 '13 16:03

Josh Antonson


2 Answers

(I'm assuming you're using Homebrew, since I hit the same issue trying to do the same thing on Homebrew on my macbook)

I believe you need to point it to the actual mysql directory in the cellar as its basedir, not at /usr/local (since that's just things symlinked from the cellar dir).

So, in my case, I had to use:

$ mysql_install_db --basedir=/usr/local/Cellar/mysql/5.6.10
like image 102
rascalking Avatar answered Nov 16 '22 03:11

rascalking


Need copy /usr/share/my.cnf
Try this:

sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
sudo mysql_install_db

Its help for me on Ubuntu 14.04 and mysql 5.6.33

like image 42
NSukonny Avatar answered Nov 16 '22 04:11

NSukonny