I am trying to use mysql_install_db
I am getting the following error:
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compi
If you use Brew, try to run mysql_install_db with --basedir="$(brew --prefix mariadb)"
Change mariadb
to mysql
if you use mysql.
Annoyingly, this just means you have to be in the right directory to execute this. Make sure you're in /usr/local/Cellar/mysql/<version>/
before running the script.
You must run the command:
# mysql_install_db --basedir=/usr/local
That is without bin
. This option must specify a directory path location of the directory ./bin
.
Anyone reading this after installing MySQL with Homebrew may have experienced this issue:
https://stackoverflow.com/questions/4788381/getting-cant-connect-through-socket-tmp-mysql-when-installing-mysql-on-m
And then found their way here after the final instruction didn't work. I simply ran
mysql.server start
after reading http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial
Then it all started working miraculously (seems I just hadn't started it?!).
For me the fix was to point basedir to the actual mysql directory in the cellar, as shown at install.
eg:
During installation of mysql (using brew install mysql56
), I was shown this path: /usr/local/Cellar/mysql56/5.6.27/bin/mysql_install_db...
I used that to define the basedir like so:
mysql_install_db --verbose --user=`whoami` --basedir="/usr/local/Cellar/mysql56/5.6.27" --datadir=/usr/local/var/mysql --tmpdir=/tmp
gotta add the path of mysql installation in system path
try: sudo path=${PATH}:/usr/local/mysql/bin
if you installed mysql in "/usr/local/mysql
"