Bug #65951 my-innodb-heavy-4g.cnf prevents server from starting
Submitted: 19 Jul 2012 15:14 Modified: 4 Oct 2012 7:15
Reporter: Benjamin Morel Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.6.5 m8 OS:Linux (CentOS 6.2)
Assigned to: CPU Architecture:Any
Tags: configuration my.cnf

[19 Jul 2012 15:14] Benjamin Morel
Description:
I've been noticing the problem with this file for a while now, on many different machines, so I'm suprised not to other mentions of it. The my-innodb-heavy-4G.cnf is broken, and prevents the server from starting.

With other sample files (eg. my-huge.cnf), the server starts successfully.

How to repeat:
# yum install MySQL-server-5.6.5_m8-1.el6.x86_64.rpm
# cp /usr/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf
# server mysql start

Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
[19 Jul 2012 17:01] Valeriy Kravchuk
Was this the first attempt to start MySQL server?

I assume that you tried to start server with other .cnf file first and then you got the following error message in the error log when you tried to start it with my-innodb-heavy-4g.cnf:

...
120719 19:50:42 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytes
InnoDB: than specified in the .cnf file 268435456 bytes!

That is, existing log file was of a different (smaller) size.
[20 Jul 2012 11:03] Benjamin Morel
I just tried it on a fresh CentOS 6.2 installation, same problem.
I used a "minimal" CentOS installation, so no other MySQL server shipped with it.

I'll attach the log file separately.
[20 Jul 2012 12:39] Benjamin Morel
Log file after fresh install + copy to /etc/my.cnf + mysql start

Attachment: localhost.localdomain.err (application/octet-stream, text), 3.53 KiB.

[20 Jul 2012 12:55] Benjamin Morel
I discovered that even when MySQL has never been started, the installer still creates ib_logfile0, ib_logfile1 & ibdata1; and these files are created with a size incompatible with the shipped my-innodb-heavy-4g.cnf.

It would be good to harmonize this!
In the meantime, here are 2 (tested) workarounds with the current version:

Workaround #1 (recommended): Remove the default InnoDB files *before* the first start:

# yum install MySQL-server-5.6.5_m8-1.el6.x86_64.rpm
# cp /usr/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf
# cd /var/lib/mysql
# rm -f ib*
# server mysql start

Workaround #2: Replace these two lines in my.cnf *before* the first start, to match the InnoDB files created by default by the RPM package:

innodb_log_file_size = 5M
innodb_log_files_in_group = 2
[20 Jul 2012 13:47] Valeriy Kravchuk
Yes, if mysql_install_db script is called during installation for whatever reason, it will create ib* files of default size (assuming that no --defaults-file option is passed and no my.cnf exists in usual places).

Settings in this .cnf file are recommended for big enough installations, where default sizes of ib* files are unreasonable. So, just setting sizes to the same default values will make this sample .cnf file less useful. It is assumed that DBA can read error log and deal with the problem if it's already happened.

I'd say this is not a bug.
[20 Jul 2012 14:23] Benjamin Morel
I'd say this is a bug in the RPM package, as it does call the mysql_install_db script as you said, and then creates files incompatible with the shipped .cnf files, which is really misleading when you don't have a quite in-depth knowledge of MySQL. You'd expect to be able to copy a shipped cnf file, start the server, and that it just works.

Suggested fix: do not create the InnoDB files during installation, as they are automatically created if they don't exist, when the server is started?
[21 Jul 2012 16:24] Valeriy Kravchuk
I think this: 

Do not call mysql_install_db during RPM installation by default (as this may prevent seamless use of sample/custom *.cnf files)

is a reasonable feature request.
[4 Oct 2012 7:15] Marko Mäkelä
The log file size problem is a duplicate of Bug#13494.