Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I was trying to compile MySQL 5.5.15 from source in Debian 6 and was using the "old-fashioned" way of doing it: i.e., run autorun.sh in BUILD and then run ./configure with quite a few options, and when I tried to start the process, here is what I see:

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
110816  9:36:06  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
InnoDB: Apply batch completed
110816  9:36:06  InnoDB: Waiting for the background threads to start
110816  9:36:07 InnoDB: 1.1.8 started; log sequence number 1595675
110816  9:36:07 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
110816 09:36:07 mysqld_safe mysqld from pid file /usr/local/mysql/data/myhost.pid ended

Here are the ./configure options that I have used:

./configure --prefix=/usr/local/mysql --with-extra-charsets=all\
            --enable-thread-safe-client --enable-assembler \
            --with-charset=utf8 --enable-thread-safe-client \
            --with-extra-charsets=all
make && make install && make install scripts

And I have run install db as well:

/usr/local/mysql/scripts/mysql_install_db --user=mysql \
--basedir=/usr/local/mysql --datadir=/usr/local/mysql/var

Added the ownership is already changed, but the problem remained:

ls -la
total 20
drwx--S---  5 mysql mysql 4096 Aug 16 09:25 .
drwxr-sr-x 14 mysql mysql 4096 Aug 16 09:25 ..
drwx--S---  2 mysql mysql 4096 Aug 16 09:25 mysql
drwx--S---  2 mysql mysql 4096 Aug 16 09:25 performance_schema
drwx--S---  2 mysql mysql 4096 Aug 16 09:25 test

Could you please help? Thanks!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This is the key

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

Make sure the data directory user is mysql

chown -R mysql.mysql /usr/local/mysql/var

Also check to make sure your data directory actually contains the mysql database and it's default tables that should have been created with the install script.

share|improve this answer
    
Mmm... I have already done this: ls -la total 20 drwx--S--- 5 mysql mysql 4096 Aug 16 09:25 . drwxr-sr-x 14 mysql mysql 4096 Aug 16 09:25 .. drwx--S--- 2 mysql mysql 4096 Aug 16 09:25 mysql drwx--S--- 2 mysql mysql 4096 Aug 16 09:25 performance_schema drwx--S--- 2 mysql mysql 4096 Aug 16 09:25 test –  zhuanyi Aug 16 '11 at 21:19
    
what are the contents of the mysql folder? Also check to make sure your my.cnf is pointing to the correct data directory –  sreimer Aug 16 '11 at 21:34
    
ls -la | grep host -rw-rw---- 1 mysql mysql 0 Aug 16 09:25 host.MYD -rw-rw---- 1 mysql mysql 2048 Aug 16 09:25 host.MYI -rw-rw---- 1 mysql mysql 9510 Aug 16 09:25 host.frm –  zhuanyi Aug 16 '11 at 21:38
    
HOLY, the last point is the solution, I need to change my data dir to specifically point to /usr/local/mysql/var, thanks so much buddy, you saved me tonnes of time! –  zhuanyi Aug 16 '11 at 21:42

Please use cmake instead of autotools. http://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.5/en/source-configuration-options.html

MySQL developers use the cmake for 5.5 branch, and "configure" is not supported anymore.

share|improve this answer

Your Answer

 
discard

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.