How to Fix “Unknown/unsupported storage engine: InnoDB” Error After Ubuntu Upgrade to Precise Pangolin


2 views

When upgrading Ubuntu to Precise Pangolin (12.04 LTS), many developers encounter MySQL startup failures with the cryptic error message about InnoDB being disabled or unsupported. This typically occurs because the upgrade process might not properly migrate the InnoDB configuration files or maintain compatibility with existing data files.

First, check your MySQL error logs thoroughly:

sudo tail -50 /var/log/mysql/error.log

Look for these telltale signs:
- "Plugin 'InnoDB' is disabled"
- "Unknown/unsupported storage engine"
- References to missing or corrupted InnoDB log files

1. Verify MySQL Installation

Ensure all required packages are properly installed:

sudo apt-get install mysql-server-5.5 mysql-client-5.5

2. Clean Up Previous Configuration

Sometimes residual files cause conflicts:

sudo rm /var/lib/mysql/ib_logfile*
sudo rm /var/lib/mysql/ibdata1

3. Reinitialize InnoDB

Add these critical parameters to your my.cnf:

[mysqld]
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_file_size = 50M
innodb_buffer_pool_size = 256M
innodb_log_files_in_group = 2

4. Special Case Handling

If upgrading from very old versions, you might need to convert tables:

ALTER TABLE table_name ENGINE=InnoDB;

For persistent issues, try forcing InnoDB initialization:

sudo mysqld --initialize-insecure --user=mysql --innodb-force-recovery=6

Before future upgrades:

  1. Dump all databases: mysqldump -u root -p --all-databases > full_backup.sql
  2. Verify storage engines: SELECT table_schema, table_name, engine FROM information_schema.tables;

After upgrading Ubuntu to a newer LTS version, many MySQL users encounter a frustrating startup failure with the following symptoms:

sudo service mysql restart
stop: Unknown instance:
start: Job failed to start

The error log (/var/log/mysql/error.log) reveals the core issue:

120415 23:01:09 [Note] Plugin 'InnoDB' is disabled.
120415 23:01:09 [Note] Plugin 'FEDERATED' is disabled.
120415 23:01:09 [ERROR] Unknown/unsupported storage engine: InnoDB
120415 23:01:09 [ERROR] Aborting

120415 23:01:09 [Note] /usr/sbin/mysqld: Shutdown complete

This error typically occurs when MySQL is upgraded but the InnoDB storage engine files aren't properly migrated. The system upgrade might have left incompatible InnoDB files or configuration that MySQL can't recognize.

Key factors contributing to this issue:

  • Mismatched MySQL versions between old and new Ubuntu installations
  • Corrupted or incompatible InnoDB log files (ib_logfile*)
  • Missing InnoDB plugin in the new MySQL installation
  • Configuration file discrepancies

Step 1: Verify MySQL Installation

First, confirm your MySQL installation status:

dpkg -l | grep mysql-server

If missing, install MySQL properly:

sudo apt-get update
sudo apt-get install mysql-server

Step 2: Clean Up and Reconfigure

Remove existing configuration and reinitialize:

sudo rm -rf /var/lib/mysql/*
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Step 3: Enable InnoDB Plugin

Edit MySQL configuration:

sudo nano /etc/mysql/my.cnf

Add or verify these lines under [mysqld] section:

[mysqld]
innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

Step 4: Reset InnoDB Log Files

Remove old log files and restart MySQL:

sudo rm /var/lib/mysql/ib_logfile*
sudo service mysql restart

If the above doesn't work and you need to recover existing databases:

sudo mysqldump --all-databases --events --routines > all_databases.sql
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get install mysql-server
sudo mysql < all_databases.sql

After implementing the solution, verify InnoDB is active:

mysql -u root -p -e "SHOW ENGINES;"

You should see InnoDB with "DEFAULT" in the Support column.

To avoid similar issues in future upgrades:

  • Always backup databases before system upgrades
  • Consider using MySQL's native upgrade tools
  • Maintain consistent configuration across versions
  • Document all custom MySQL settings