Mysql_install_db cannot find file

I am trying to use mysql_install_db

I get the following error:

FATAL ERROR: Could not be found. / bin / my _print_defaults

If you compiled the source code, you need to run 'make install' to copy the software to the right place, ready to go.

If you are using the binary version, you must either be at the top of the extracted archive level or pass the --basedir option pointing to this place.

I tried using

which my_print_defaults 

It returns:

  /usr/local/bin/my_print_defaults 

So, I try the command:

  mysql_install_db --base-dir=/usr/local/bin/ 

I still get the same error. Please, help.

+6
source share
5 answers

Annoyingly, it just means that you have to be in the right directory in order to accomplish this. Before running the script, make sure you are in /usr/local/Cellar/mysql/<version>/ .

+19
source

You must run the command:
# mysql_install_db --basedir=/usr/local
This is without bin . This parameter should indicate the location of the directory path in the ./bin directory.

+4
source

Anyone reading this after installing MySQL using Homebrew may have encountered this problem:

https://stackoverflow.com/questions/4788381/getting-cant-connect-through-socket-tmp-mysql-when-installing-mysql-on-m

And then they found their way here after the final instruction did not work. I just ran

 mysql.server start 

after reading http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial

Then all this began to work in a miraculous way (it seems I just did not start it ?!).

+4
source

If you are using Brew , try running mysql_install_db with --basedir="$(brew --prefix mariadb)"

Change mariadb to mysql if you are using mysql .

0
source

For me, the fix was to point to the actual mysql directory in the basement, as shown on the installation page.

eg:

During mysql installation (using brew install mysql56 ) this path was shown to me: /usr/local/Cellar/mysql56/5.6.27/bin/mysql_install_db...

I used this to define basedir like this:

 mysql_install_db --verbose --user=`whoami` --basedir="/usr/local/Cellar/mysql56/5.6.27" --datadir=/usr/local/var/mysql --tmpdir=/tmp 
0
source

Source: https://habr.com/ru/post/949261/


All Articles