A little cleanup – after testing out MySql's ACID compliant storage engine InnoDb some months ago I had a 3 Gigabytes large IBDATA1 cluttering my server's 10k SCSI disks… compared to the 300GB desktop drives this is just 1%, but for a 72 GB high end disk that's around 5% – on a partition not too oversized…
No Innodb data was stored, so I thought they have a bug in there not freeing up unused space... right.
The solution would be an update to an Cpanel unsupported MySql 4.1.1 to use the new setting _innodb_file_per_table_ to create a datafile per table (myisam behaviour) and having congestions in once single file in one – up to the filesystem max filesize – then you die.
but….
see this
A critical bug found: if one uses the 4.1 my.cnf option
innodb_file_per_table
to create tables, and some of the secondary index records are inserted to
the InnoDB 'insert buffer ', then after a normal mysqld shutdown InnoDB loses
all those secondary index records! CHECK TABLE will print to the mysqld .err
log that there are less records in the secondary index than in the clustered
index.
Doesn't sound worth an upgrade to get rid of old datafiles… after all I ant to disable innodb on this server after cleanup.
so I though – "just delete the crap and restart"...
cd /var/lib/mysql
mkdir old-inno
mv ./ib* old-inno
and then restart mysql
you should find this
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050515 11:00:33 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait…
050515 11:00:34 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait…
050515 11:00:35 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
050515 11:00:38 InnoDB: Started
/usr/sbin/mysqld: ready for connections.
Version: '4.0.22-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Official MySQL RPM
and NOT this
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050515 10:56:52 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Error: all log files must be created at the same time.
InnoDB: All log files must be created also in database creation.
InnoDB: If you want bigger or smaller log files, shut down the
InnoDB: database and make sure there were no errors in shutdown.
InnoDB: Then delete the existing log files. Edit the .cnf file
InnoDB: and start the database again.
050515 10:56:53 Can't init databases
050515 10:56:53 Aborting
050515 10:56:53 InnoDB: Warning: shutting down a not properly started
InnoDB: or created database!
050515 10:56:53 /usr/sbin/mysqld: Shutdown Complete
050515 10:56:53 mysqld ended
log output… if it was the latter, then you missed one of the log files… (just as I did :-)
Remember: this operation will DESTROY all your innodb data – make sure you don't have some transaction data left in there, at least to a logical mysql dump before…
This is however a supported (at least documented) way to create new ibdata datafiles – without upgrading to 4.1.1 or hassling around with other bugs for a subsystem you don't need now… just the defensive way necessary for production systems (altough the catchy Hardcore title might suggest it different :-)
Disabling INNODB is easy, just add in the [mysqld] section
skip-innodb
to your /etc/my.cnf and restart mysql (e.g. /scripts/restartsrv_mysql)
there you go… This will save memory and disk
space and speed up some things.
Recent comments
2 days 19 min ago
1 week 15 hours ago
1 week 2 days ago
10 weeks 1 day ago
10 weeks 1 day ago
10 weeks 3 days ago
10 weeks 4 days ago
11 weeks 3 days ago
19 weeks 3 hours ago
21 weeks 2 days ago