mxcl/homebrew — Issue #8063: mysql 5.5.15 mysql_install_db ignores "--datadir"
Author: aicm
Created: 2011-10-11 03:55:50+00:00
State: open

Hello,

I just realized that even after I have set up mysql using the command below, it refuses to start saying that mysql.host is missing. I can see it inside ~/mysql but mysql.server looks for the datadir where it usually is: /usr/local/var/mysql.

```bash
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/Users/macpro/mysql --tmpdir=/tmp
Installing MySQL system tables...
OK
Filling help tables...
OK

```

Here's the log entry

111010 23:46:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
111010 23:46:33 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
/usr/local/Cellar/mysql/5.5.15/bin/mysqld: Table 'mysql.plugin' doesn't exist
111010 23:46:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
111010 23:46:33 InnoDB: The InnoDB memory heap is disabled
111010 23:46:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
111010 23:46:33 InnoDB: Compressed tables use zlib 1.2.5
111010 23:46:33 InnoDB: Initializing buffer pool, size = 128.0M
111010 23:46:33 InnoDB: Completed initialization of buffer pool
111010 23:46:33 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 48941
111010 23:46:33 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1595675
111010 23:46:33 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
111010 23:46:34 InnoDB: Waiting for the background threads to start
111010 23:46:35 InnoDB: 1.1.8 started; log sequence number 1595675
111010 23:46:35 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
111010 23:46:35 mysqld_safe mysqld from pid file /usr/local/var/mysql/macpro.local.pid ended

Thanks

PS: markdown stinks.