MySQL-Table ‘mysql.host’ doesn’t exist

MySQL-Table ‘mysql.host’ doesn’t exist

夜无邪 发布于 2017-06-28 字数 2148 浏览 1159 回复 1

我用的是EasyPHP,一直没有问题的,突然有一次打开EasyPHP,就出现了:Unexpected end of mysql...See log file?
在网上找了不少办法都还是没有解决,于是重新安装了EasyPHP,奇怪的是,重新安装竟然还有这个问题,下边是重装后的报错信息:

120910  9:45:51 [Note] Plugin 'FEDERATED' is disabled.
120910 9:45:51 InnoDB: The InnoDB memory heap is disabled
120910 9:45:51 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120910 9:45:51 InnoDB: Compressed tables use zlib 1.2.3
120910 9:45:51 InnoDB: Initializing buffer pool, size = 16.0M
120910 9:45:51 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .ibdata1 did not exist:
InnoDB: a new database to be created!
120910 9:45:51 InnoDB: Setting file .ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
120910 9:45:51 InnoDB: Log file .ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
120910 9:45:52 InnoDB: Log file .ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
120910 9:45:53 InnoDB: Waiting for the background threads to start
120910 9:45:54 InnoDB: 1.1.8 started; log sequence number 0
120910 9:45:54 [Note] Recovering after a crash using mysql-bin
120910 9:45:54 [Note] Starting crash recovery...
120910 9:45:54 [Note] Crash recovery finished.
120910 9:45:54 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
120910 9:45:54 [Note] - '127.0.0.1' resolves to '127.0.0.1';
120910 9:45:54 [Note] Server socket created on IP: '127.0.0.1'.
120910 9:45:54 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮生未歇 2017-09-26 1 楼

应该是你的数据库有问题了,可以采用以下办法尝试一下:
step 1.使用 mysqld --skip-grant 命令启动mysql
step 2.使用 mysqldump 将库数据导出
step 3.使用 mysqladmin shutdown 停止mysqld 服务
step 4.在shell 下进入mysql数据目录,删除下面的 mysql 库
step 5.运行 mysql_install_db 重新创建默认的 mysql 库
step 6.运行mysqld服务,检查导入库数据,重新创建库用户、密码以及设置权限
step 7.执行cat /etc/mysql/debian.cnf 查看 debian-sys-maint帐号密码,运行mysql执行如下命令添加帐号
mysql> GRANT ALL PRIVILEGES ON . TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '前面看到的密码' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

(如没有重要数据,可以忽略步骤1,2,3)