Version: 1.6.0 (using KDE 4.6.5) OS: Linux I use external MySQL server for Akonadi, and my SQL Server configured to 50 minutes IDLE timeout (wait_timeout and interactive_timeout mysql variables). IE MySQL server closed connection if not see any activity on its during 50 minutes. Looks like Akonadi incompatable with this MySQL settings, and can't restore connection if it closed. Error during selection of record with id 0 from table "CollectionTable" "MySQL server has gone away QMYSQL: Unable to execute query" Error during executing query "SELECT PimItemTable.id, PimItemTable.remoteId, MimeTypeTable.name, ResourceTable.name, PimItemTable.rev, PimItemTable.remoteRevision, PimItemTable.size, PimItemTable.datetime, PimItemTable.collectionId FROM PimItemTable INNER JOIN MimeTypeTable ON ( PimItemTable.mimeTypeId = MimeTypeTable.id ) INNER JOIN CollectionTable ON ( PimItemTable.collectionId = CollectionTable.id ) INNER JOIN ResourceTable ON ( CollectionTable.resourceId = ResourceTable.id ) WHERE ( collectionId = :0 ) ORDER BY PimItemTable.id DESC" : "MySQL server has gone away QMYSQL: Unable to execute query" Reproducible: Always Steps to Reproduce: 1. Configure Akonadi for use external MySQL server 2. Keep akonadi server runing without any task a some time (more then wait_timeout and interactive_timeout mysql variables) 3. Any activity after this time (I try simple getemails from my mailbox) produce SQL errors and fail to work. Actual Results: Error during selection of record with id 0 from table "CollectionTable" "MySQL server has gone away QMYSQL: Unable to execute query" Error during executing query "SELECT PimItemTable.id, PimItemTable.remoteId, MimeTypeTable.name, ResourceTable.name, PimItemTable.rev, PimItemTable.remoteRevision, PimItemTable.size, PimItemTable.datetime, PimItemTable.collectionId FROM PimItemTable INNER JOIN MimeTypeTable ON ( PimItemTable.mimeTypeId = MimeTypeTable.id ) INNER JOIN CollectionTable ON ( PimItemTable.collectionId = CollectionTable.id ) INNER JOIN ResourceTable ON ( CollectionTable.resourceId = ResourceTable.id ) WHERE ( collectionId = :0 ) ORDER BY PimItemTable.id DESC" : "MySQL server has gone away QMYSQL: Unable to execute query" Expected Results: I think will be a good idea use mysql_ping (or exec "SELECT 1") for verify if MySQL connection is live, and if connection was lost, try reconnect to MySQL server before execute a query or return connection from DB poll. PS. One more issue, not sure maybe it already fixed but when I try configure Akonadi to use external MySQL server it fail to initialize a new DB. DB was created, but tables not - so I was need move a tables from buildin MySQL to external.
This has been fixed in current git and will be available in Akonadi 1.10.3. As you suggested, the Akonadi server is sending dummy queries to MySQL server from time to time to keep the connection alive.
*** Bug 303922 has been marked as a duplicate of this bug. ***