dpkg –configure Error for mysql-server-5.1

After starting the year by upgrading my Ubuntu desktop at work to 5.1 (and spending a couple of hours after borking my new kernel), my mysql-server had become lost in the transition.

Reinstalling the mysql-server package gave a cryptic error message:

Setting up mysql-server-5.1 (5.1.37-1ubuntu5) ...
Installing new version of config file /etc/init.d/mysql ...
 * Stopping MySQL database server mysqld                                 [ OK ] 
Warning: found usr.sbin.mysqld in /etc/apparmor.d/force-complain, forcing complain mode
 * Starting MySQL database server mysqld                                 [fail] 
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.1; however:
  Package mysql-server-5.1 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for menu ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Quite weird, yes. Trying to find anything in the mysql-logs didn’t yield anything either (both were empty), but luckily the syslog provided an answer this time. Among loads of other messages regarding mysql the answer hid from general view:

Jan  7 14:30:48 ubuntu mysqld_safe[20249]: 100107 14:30:48 [ERROR] /usr/sbin/mysqld: unknown option '--skip-bdb'
Jan  7 14:30:48 ubuntu mysqld_safe[20249]: 100107 14:30:48 [ERROR] Aborting

Taking a look at the mysql config file in /etc/mysql/my.cnf confirmed this:

# * BerkeleyDB
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.

Apparently not just the support ceased, but also the skip-bdb parameter. That seems a bit odd – I’d suggest at least keeping the parameter around for another release cycle, but anyhow:

# * BerkeleyDB
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
# skip-bdb

And suddenly everything went in the right general direction!

15 thoughts on “dpkg –configure Error for mysql-server-5.1”

  1. Thanks buddy! This error occurs when updating your MySQL to a backported version. Solved it completely.

  2. Ah had this problem twice now, again I found the solution here..

    Thanks again. Please keep the website up ;)

  3. Did upgrade 5.0 -> 6.0

    Was getting mad finding no log entries in the normal mysql logs. How dumb not to have a look in syslog :-)


  4. If you still get the same error (and be sure that you actually get the error about –skip-bdb), you might have to check the safe_mysqld / mysqld_safe scripts to see if they include it manually, or try to find out what location MySQL is reading it configuration files from (remember, there might be different locations for different distros and different installation methods).

  5. Brilliant. This kind of headache comes when we don’t allow dpkg to replace config files automatically (rebuilding config files are never fun). Anyway, this really helped me today. Thanks.

  6. @vijay: The location will depend on your distribution and the version of said distribution, so I’d suggest doing a find or locate to discover where the file is located.

Leave a Reply

Your email address will not be published. Required fields are marked *