我正在使用 mysql 版本 14.12 distrib 5.0.26。在更改 my.cnf 文件后,我收到以下消息:
下面是我写的错误日志文件。
100915 15:27:29 mysqld started
100915 15:27:29 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...
100915 15:27:29 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
100915 15:27:29 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 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 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
100915 15:27:29 InnoDB: Started; log sequence number 0 43655
100915 15:27:29 [Note] Recovering after a crash using /data/binarylog/patan
100915 15:27:29 [Note] Starting crash recovery...
100915 15:27:29 [Note] Crash recovery finished.
100915 15:27:29 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
100915 15:27:29 mysqld ended
为什么会出现这个错误?
有人能告诉我吗?
答案1
除非您彻底清除了mysql
数据库,否则权限可能不正确。MySQL 通常以 的身份运行mysql:mysql
。如果您的数据目录位于 中,/usr/local/mysql/data
则您需要确保该目录中的所有数据库均归 拥有mysql:mysql
。