2

I installed Mysql 5.5 using Homebrew, specifically Homebrew versions - https://github.com/Homebrew/homebrew-versions. After the installation, I attempted to run the commands it suggests:

Set up databases to run AS YOUR USER ACCOUNT with:
    unset TMPDIR
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
...

However, the second line causes an error. When I run:

mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

I get the following error:

FATAL ERROR: Could not find my_print_defaults

The following directories were searched:

/usr/local/Cellar/mysql/5.6.10/bin
/usr/local/Cellar/mysql/5.6.10/extra

Perhaps this is because the script is by default searching for files in my old mysql 5.6 directory even though I ran "brew uninstall mysql" before doing this.

Still, if I specify the new mysql installation directory, I still get an error:

$ mysql_install_db --verbose --user=`whoami` --basedir="$/usr/local/Cellar/mysql55/5.5.30" --datadir=/usr/local/var/mysql --tmpdir=/tmp

FATAL ERROR: Could not find my_print_defaults

The following directories were searched:

    $/usr/local/Cellar/mysql55/5.5.30/bin
    $/usr/local/Cellar/mysql55/5.5.30/extra

This is strange because the first directory indeed does contain my_print_defaults if I ls the directory.

Why, then, am I still getting this error?

1

1 Answer 1

2

I ran into this same problem. Part of the problem is that your mysql_install_db line is incorrect. As I documented here, you have to perform the following steps - including one before running the mysql_install_db command - to avoid subsequent errors:

  1. Change the name of /usr/local/opt/mysql55/share/mysql55 to /usr/local/opt/mysql55/share/mysql
  2. Run the following command (same as above with one variation in the --datadir argument):

    mysql_install_db --verbose --user=whoami --basedir="$(brew --prefix mysql55)" --datadir=/usr/local/var/mysql55 --tmpdir=/tmp

If you look at the output from when mysql is being installed it has datadir set to /usr/local/var/mysql55.

  1. Rename /usr/local/opt/mysql55/share/mysql back to /usr/local/opt/mysql55/share/mysql55
  2. Start the server

Step 3 is necessary because you get the "The server quit without updating PID file.." error when trying to start the mysql server, and the apache error log shows errors trying to find /usr/local/opt/mysql55/share/mysql55/english/errmsg.sys.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .