Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 - 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?

share|improve this question

migrated from stackoverflow.com 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 - dev.mysql.com/downloads/mysql/5.5.html#downloads – 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

You must log in to answer this question.

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