sqlgrey problem

249 views
Skip to first unread message

electricart

unread,
Sep 17, 2012, 10:18:56 PM9/17/12
to mail...@googlegroups.com
Hi all,

We have a Mailserv installation running on OpenBSD 4.9, which has been running fine for some time. Recently though, I cannot view greylisted servers (whitelist is ok), and if I look at the maillog, there are many errors like the following;

sqlgrey: warning: Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/local/sbin/sqlgrey

sqlgrey: dbaccess: error: couldn't get reconnect delay:  
sqlgrey: dbaccess: error: Couldn't access connect table: 

I'm guessing that the database has been corrupted somehow? Does anyone know what tables might be safe to delete to get it back to a working state? Would sqlgrey then recreate needed tables automatically?

Any help with this matter would be greatly appreciated!

thanks,
Tristan.

David Gnojek

unread,
Sep 19, 2012, 6:14:17 AM9/19/12
to mail...@googlegroups.com
Hi Tristan,

Lets try to re-create sqlgrey database from scracht in case is corrupted.

stop sqlgrey
#god stop sqlgrey

backup it for sure
# mysqldump sqlgrey > /root/sqlgrey.sql

drop db
#mysql -e "drop database sqlgrey;"

create new empty db from scratch
#/usr/local/bin/mysqladmin create sqlgrey

set privilegies
#/usr/local/bin/mysql -e "grant all privileges on sqlgrey.* to 'sqlgrey'@'localhost' identified by 'sqlgrey';"

run sqlgrey, will fill db during start
#/usr/local/sbin/sqlgrey -d

set primary key
#/usr/local/bin/mysql sqlgrey -e "alter table connect add id int primary key auto_increment first;"

kill sqlgrey
#ps ax| grep sqlgrey | awk '{print $1}' | xargs kill -9

run it in standard way
#god start sqlgrey

Cheers

David

electricart

unread,
Sep 30, 2012, 3:10:36 AM9/30/12
to mail...@googlegroups.com
Hi David,

That seems to have worked, thanks!

The only bit that didn't seem to work ok was the mysqldump command for some reason - I got the following error;

mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `connect`': Got error 134 from storage engine (1030)

It was fine as I just did a snapshot of the server before I changed the database, and all the other commands completed fine, and it all seems to be working now!

Thanks again,
Tristan.
Reply all
Reply to author
Forward
0 new messages