HI Carl,
The ibdata file growth can be stopped by removing the autoextend
keyword in the my.cnf file.
In your my.cnf file the entry might be
innodb_data_file_path = ibdata1:256M:autoextend
If you want to stop the growth of that file and add another file then this
is what you want to do.
1. Stop the mysql server
2. Get the size of the ibdata1 file in MB (Lets say its 5600MB in size)
3. edit the my.cnf file and replace
innodb_data_file_path = ibdata1:256M:autoextend
with
innodb_data_file_path = ibdata1:5600M;ibdata2:256M:autoextend
4. Start the server.
This will stop that file from growing and a new file will be added that
can pushed on to a different disk and symlinked into the ibdata directory.
Data growth is a problem in all table types. Even if you migrate to MyISAM
you need space.
See whether there is log_bin turned on the server. If so there might be
lots of bin log files that you can do a cleanup on. Bin logs occupy a
great deal of space.
Thanx
Alex,
MySQL DBA
Yahoo!
On Tue, 03 Jan 2006 08:28:24 +0530, Carl Brewer <carl@stripped>
wrote:
>
>
> Hello,
>
> I'm stuck with a rapidly decreasing amount of available disk space and
> a requirement to keep a lid on the size of our databases. We're
> using MySQL 4.1.12 as bundled with RHEL ES 4. We do a lot of
> transactions keeping short term track of webserver sessions, which
> we don't need to keep logs of for very long.
>
> I have a number of databases, almost all of which are using MyISAM or
> HEAP, and one database using InnoDB. As such (or at least, as I
> understand it) we have a ibdata1 file that will grow forever and
> AFAIK there's no way to stop it growing forever for as long
> as we have that InnoDB database. Am I correct? I'm no MySQL
> guru, my parsing of TFM and googling around and finding bug and feature
> requests for ibdata1 purging suggests that this is the case.
>
> If so, if I drop the InnoDB database, stop mysqld, delete (UNIX
> filesystem) the imdata1 file, restart mysqld and import a
> (modified to be MyISAM) dumped copy of the InnoDB database,
> will that work without damaging anything and then not leave me
> with another infinatly growing imdata1 file?
>
> Am I correct in assuming that InnoDB databases are meant
> for sites where disk space is not ever likely to be an
> issue, and MyISAM is a more suitable database engine for
> our much tighter disk space situation? I may have missed
> a section of the doco that discusses why one would choose an
> engine over another?
>
> Thanks for any advice,
>
> Carl
>
>