MySQL the.cnf file not being read, Ubuntu 10.04 64bit

linodeMySQLubuntu-10.04

I've been researching this for a few hours with no luck. Basically it looks like my server's my.cnf file isn't being read at all.

I've searched my server, and there's only one my.cnf file on it, located at /etc/mysql/my.cnf. Its ownership is root:root.

I'm running Ubuntu 10.04 64bit on a Linode.com server. I have the latest versions of MySQL and PHP installed.

I've edited the my.cnf file, commented out "skip-innodb", and have set innodb to be the default storage engine using

default-storage-engine = innodb

And then restarted mysql.

But when I do show engines, MyISAM is still coming up as the default engine.

Also – none of the innodb settings I've added to the my.cnf file are being read. For example, I have this in my.cnf:

innodb_buffer_pool_size=4G

But in phpmyadmin, InnoDB is showing as having a buffer pool size of 8,192 KiB.

Similarly, I have this in the my.cnf:

innodb_data-file_path = ibdata1:500M:autoextend

But in phpmyadmin, it's reading as ibdata1:10M:autoextend.

It doesn't look like MyISAM info is being read from the my.cnf file either. The my.cnf file has skip-external-locking queried out, but it's showing as "on" in phpmyadmin.

So – yeah, it looks like nothing in the my.cnf file is being read at all.

But the server still works. I'm running a Drupal site on it and it seems to operate fine. So mysql seems to be drawing default settings from… some mysterious secret location.

Any idea how I can make mysql see and use this my.cnf file?


Actually, wait – it looks like it may be being read, not sure. I checked the error.log and found this:

101128  4:28:52 [ERROR] Cannot find or open table databasename/cache_apachesolr from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html
how you can resolve the problem.

InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 640 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 32000 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
101128  4:28:52 [ERROR] Plugin 'InnoDB' init function returned error.
101128  4:28:52 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
101128  4:28:52 [ERROR] /usr/sbin/mysqld: unknown variable 'innodb_lock_wait_timout=50'
101128  4:28:52 [ERROR] Aborting

101128  4:28:52 [Note] /usr/sbin/mysqld: Shutdown complete

Best Answer

Similarly to how you cannot change the log file size without re-creating the innodb logs, you also cannot re-specify the ibdata file size without re-creating it. Besides, there is no need to resize it larger since it defaults to an auto-extending file. Here is the relevant bit of the error that tells you this is a problem:

    InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
    InnoDB: 640 pages (rounded down to MB) than specified in the .cnf file

So I would remove that from my.cnf. Also you may have a typo somewhere in your config since the error log also says that "innodb_lock_wait_timout" is an invalid variable, but it does not appear to be invalid according to the manual.

It is mysterious though how mysql is running at all when it's clearly aborted during startup due to the invalid my.cnf.