我试图从Debian 6的源代码编译MySQL 5.5.15,并使用“老式”的方法:即在BUILD中运行autorun.sh,然后用相当多的选项运行./configure,我试图开始这个过程,这里是我所看到的:
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
这里是我用过的./configure选项:
./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
我也运行安装数据库:
/usr/local/mysql/scripts/mysql_install_db --user=mysql \ --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var
增加了所有权已经改变,但问题依然存在:
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
能否请你帮忙? 谢谢!
这是关键
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
确保数据目录用户是mysql
chown -R mysql.mysql /usr/local/mysql/var
另外请检查以确保您的数据目录实际上包含mysql数据库,并且它是应该使用安装脚本创build的默认表。
请使用cmake而不是autotools。 http://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.5/en/source-configuration-options.html
MySQL开发人员使用cmake for 5.5分支,而“configure”不再受支持。