/usr/libexec/mysqld: Can’t find file: ‘./mysql/host.frm’

时间 : 16-01-18 栏目 : linux运维 作者 : 老薛 评论 : 0 点击 : 1,500 次

现象:

[root@mailserver mysql]# /etc/init.d/mysqld start
MySQL Daemon failed to start.
正在启动 mysqld:                                          [失败]

查看错误日志信息如下:

[root@mailserver mysql]# tail -f mailserver.err
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 44233
160118 12:06:07  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 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
160118 12:06:08  InnoDB: Started; log sequence number 0 44233
160118 12:06:08 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
160118 12:06:08 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
160118 12:06:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

解决办法:

[root@mailserver mysql]# ll
总用量 20492
-rw-rw---- 1 mysql mysql 10485760 1月  18 12:04 ibdata1
-rw-rw---- 1 mysql mysql  5242880 1月  18 12:20 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 1月  18 12:04 ib_logfile1
-rw-r----- 1 mysql mysql     3154 1月  18 12:06 mailserver.err
drwx------ 2 mysql mysql     4096 1月  18 11:33 mysql
drwx------ 2 mysql mysql     4096 1月  18 11:33 test
[root@mailserver mysql]# rm -fr mysql/
[root@mailserver mysql]# ll
总用量 20488
-rw-rw---- 1 mysql mysql 10485760 1月  18 12:04 ibdata1
-rw-rw---- 1 mysql mysql  5242880 1月  18 12:20 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 1月  18 12:04 ib_logfile1
-rw-r----- 1 mysql mysql     3154 1月  18 12:06 mailserver.err
drwx------ 2 mysql mysql     4096 1月  18 11:33 test
[root@mailserver mysql]# /etc/init.d/mysqld start        
初始化 MySQL 数据库: WARNING: The host 'mailserver' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mailserver password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [确定]
正在启动 mysqld:                                          [确定]
[root@mailserver mysql]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State      
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:50718               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:30847               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
tcp        0      0 ::1:631                     :::*                        LISTEN      
tcp        0      0 ::1:25                      :::*                        LISTEN      
tcp        0      0 :::35993                    :::*                        LISTEN      
tcp        0      0 :::50718                    :::*                        LISTEN      
tcp        0      0 :::111                      :::*                        LISTEN    

本文标签

除非注明,文章均为( 老薛 )原创,转载请保留链接: http://www.bdkyr.com/xtyw002/1146.html

/usr/libexec/mysqld: Can’t find file: ‘./mysql/host.frm’:等您坐沙发呢!

发表评论

7 + 0 = ?


博主微信号,很高兴为您提供帮助

随便看看

为您推荐

0