title: MySQL InnoDB problems - InnoDB registration fails
body: <p>I recently attempted to upgrade a MySQL 5.1 server to 5.7. When the server wouldn't start, I discovered you have to export the data first, else do numerous upgrades (the binaries for which aren't available anymore), so I rolled back to 5.1 to do an export.</p>
  
  <p>The problem is, back on 5.1, InnoDB will no longer register. In the error log i get:</p>
  
  <pre><code>InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
  InnoDB: than specified in the .cnf file 0 5242880 bytes!
  160822 17:05:12 [ERROR] Plugin 'InnoDB' init function returned error.
  160822 17:05:12 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  </code></pre>
  
  <p>As a workaround I set <code>innodb_log_file_size=50331648</code> in <code>my.cnf</code>. Another restart and:</p>
  
  <pre><code>InnoDB: No valid checkpoint found.
  InnoDB: If this error appears when you are creating an InnoDB database,
  InnoDB: the problem may be that during an earlier attempt you managed
  InnoDB: to create the InnoDB data files, but log file creation failed.
  InnoDB: If that is the case, please refer to
  InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html
  </code></pre>
  
  <p>Reading that links it suggests to <code>delete all files created by InnoDB: all ibdata files and all ib_logfile files</code>. I have a 120 GB ibdata file that I most certainly do not intend to delete, so this is a non-starter. I did try renaming the logfiles though and the server still wouldn't come up.</p>
  
  <p>Any pointers from here?</p>
  
  <p>Edit: I also tried renaming the iblog files. That causes another error where mysql suggests setting <code>innodb_force_recovery=6</code>. Doing that causes these errors:</p>
  
  <pre><code>160823 12:17:32  InnoDB: Page checksum 271832187, prior-to-4.0.14-form checksum 315921779
  InnoDB: stored checksum 401867329, prior-to-4.0.14-form stored checksum 401867329
  InnoDB: Page lsn 96 3891045697, low 4 bytes of lsn at page end 3891045697
  InnoDB: Page number (if stored to page already) 966706,
  InnoDB: space id (if created with &gt;= MySQL-4.1.1 and stored already) 0
  InnoDB: Page may be a system page
  InnoDB: Database page corruption on disk or a failed
  InnoDB: file read of page 966706.
  InnoDB: You may have to recover from a backup.
  InnoDB: It is also possible that your operating
  InnoDB: system has corrupted its own file cache
  InnoDB: and rebooting your computer removes the
  InnoDB: error.
  InnoDB: If the corrupt page is an index page
  InnoDB: you can also try to fix the corruption
  InnoDB: by dumping, dropping, and reimporting
  InnoDB: the corrupt table. You can use CHECK
  InnoDB: TABLE to scan your table for corruption.
  InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html
  InnoDB: about forcing recovery.
  InnoDB: Database page corruption on disk or a failed
  InnoDB: file read of page 966707.
  InnoDB: You may have to recover from a backup.
  160823 12:17:32  InnoDB: Page dump in ascii and hex (16384 bytes):
  </code></pre>