Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Mysql 5.5 using Homebrew, specifically 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:


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:


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?

share|improve this question

migrated from Jun 13 '13 at 0:44

This question came from our site for professional and enthusiast programmers.

I fixed this by uninstalling it with Homebrew and reinstalling it with a package - – Eric Baldwin Jun 13 '13 at 23:59

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.