Error: Couldn’t read status information for table general_log ()

I got the below errors when I took the MYSQL backup using mysqldump command :

Error: Couldn’t read status information for table general_log ()
mysqldump: Couldn’t execute ‘show create table `general_log`’: Table ‘mysql.general_log’ doesn’t exist (1146)

Checking more on this, found that it is a bug. Following are the workaround :

Login to your mysql : mysql -u root -p
select the database mysql : use mysql
Create the below tables :

CREATE TABLE IF NOT EXISTS general_log (
event_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user_host mediumtext NOT NULL,
thread_id int(11) NOT NULL,
server_id int(10) unsigned NOT NULL,
command_type varchar(64) NOT NULL,
argument mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT=’General log’;

CREATE TABLE IF NOT EXISTS slow_log (
start_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user_host mediumtext NOT NULL,
query_time time NOT NULL,
lock_time time NOT NULL,
rows_sent int(11) NOT NULL,
rows_examined int(11) NOT NULL,
db varchar(512) NOT NULL,
last_insert_id int(11) NOT NULL,
insert_id int(11) NOT NULL,
server_id int(10) unsigned NOT NULL,
sql_text mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT=’Slow log’;”

Now I am able to ‘mysqldump’ the databases. But I have noticed that another error is there while using the below command :

mysql> flush privileges;
ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

As the error indicates, Just create the same as below:

mysql>CREATE TABLE `servers` ( `Server_name` char(64) NOT NULL,

`Host` char(64) NOT NULL,

`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,

`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,

`Socket` char(64) DEFAULT NULL,

`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`) )

ENGINE=MyISAM

DEFAULT CHARSET=utf8

COMMENT=’MySQL Foreign Servers table’;

Now everything works fine……

Hope it helps somebody else too……

Enjoy !  🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s