MySQL Forums
Forum List  »  Data Recovery

recovering a database
Posted by: Marc Jackson
Date: February 05, 2007 04:47PM

Hello,

I'm trying to recover a 4.1 database running on RedHat linux enterprise 4.

I'm trying to start the database with: /usr/local/mysql/bin/mysqld_safe --verbose --datadir=/var/lib/mysql/mysql --log-error=/var/log/mysql.err

/var/log/mysql.err says:

cat /var/log/mysql.err
070205 14:28:11 mysqld started
070205 14:28:11 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...
070205 14:28:11 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43922.
InnoDB: Doing recovery: scanned up to log sequence number 0 43922
070205 14:28:11 InnoDB: Flushing modified pages from the buffer pool...
070205 14:28:11 InnoDB: Started; log sequence number 0 43922
070205 14:28:11 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: 'host' (errno: 2)
070205 14:28:11 mysqld ended

The datadir of /var/lib/mysql/mysql doesn't look right. When I take off the second mysql, the error log says:

cat /var/log/mysql.err
070205 14:28:11 mysqld started
070205 14:28:11 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...
070205 14:28:11 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43922.
InnoDB: Doing recovery: scanned up to log sequence number 0 43922
070205 14:28:11 InnoDB: Flushing modified pages from the buffer pool...
070205 14:28:11 InnoDB: Started; log sequence number 0 43922
070205 14:28:11 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: 'host' (errno: 2)
070205 14:28:11 mysqld ended

070205 14:28:50 mysqld started
070205 14:28:50 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...
070205 14:28:50 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
070205 14:28:50 InnoDB: Flushing modified pages from the buffer pool...
070205 14:28:50 InnoDB: Started; log sequence number 0 43634
070205 14:28:50 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
070205 14:28:50 mysqld ended

070205 14:36:04 mysqld started
070205 14:36:04 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...
070205 14:36:04 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43922.
InnoDB: Doing recovery: scanned up to log sequence number 0 43922
070205 14:36:04 InnoDB: Flushing modified pages from the buffer pool...
070205 14:36:04 InnoDB: Started; log sequence number 0 43922
070205 14:36:04 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: 'host' (errno: 2)
070205 14:36:04 mysqld ended

A listing of /var/lib/mysql shows:

ls /var/lib/mysql/mysql
columns_priv.frm help_relation.MYI time_zone_leap_second.MYI
columns_priv.ISD help_topic.frm time_zone.MYD
columns_priv.ISM help_topic.MYD time_zone.MYI
db.frm help_topic.MYI time_zone_name.frm
db.ISD host time_zone_name.MYD
db.ISM host.frm time_zone_name.MYI
func.frm host.ISD time_zone_transition.frm
func.ISD host.ISM time_zone_transition.MYD
func.ISM ibdata1 time_zone_transition.MYI
help_category.frm ib_logfile0 time_zone_transition_type.frm
help_category.MYD ib_logfile1 time_zone_transition_type.MYD
help_category.MYI tables_priv.frm time_zone_transition_type.MYI
help_keyword.frm tables_priv.ISD user.frm
help_keyword.MYD tables_priv.ISM user.ISD
help_keyword.MYI time_zone.frm user.ISM
help_relation.frm time_zone_leap_second.frm
help_relation.MYD time_zone_leap_second.MYD

I linked host to host.frm. I'm guessing that table mysql.host is missing. Is it possible to forge this?

Regards,

Marc

Options: ReplyQuote


Subject
Views
Written By
Posted
recovering a database
8007
February 05, 2007 04:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.