Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-20-2009, 04:29 PM   #1
Registered: Sep 2007
Location: San Diego, CA
Posts: 223

Rep: Reputation: 20
MySQL ibdata1 growing and growing and growing and...

RHEL5, mysql-5.0.45-7.el5, and I know jack about MySQL.

/var/lib/mysql/ibdata1 just keeps growing bigger and bigger. I believe it may be logging each transaction. I really need to stop this... it's on a VM with limited disk space, and I really don't care if transactions cannot be recovered.

1) How do I shrink the file? Right now, my best guess is to dump the databases, stop mysqld, delete /var/lib/mysql/ibdata1, start mysqld, hope it works, and restore the databases. Yes/no?

2) How do I tell mysqld to not keep collecting gigabytes of information? If there's an easy way to have it keep the last X days worth, great. If not, how do I tell it to not do any logging at all, if that's what it's doing?
Old 07-20-2009, 07:11 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,048

Rep: Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662Reputation: 2662
You need to read this part of the manual: and maybe look at Per-Table Tablespaces

However, the key thing in the first link is:
Two important disk-based resources managed by the InnoDB storage engine are its tablespace data files and its log files. If you specify no InnoDB configuration options, MySQL creates an auto-extending 10MB data file named ibdata1 and two 5MB log files named ib_logfile0 and ib_logfile1 in the MySQL data directory. To get good performance, you should explicitly provide InnoDB parameters as discussed in the following examples. Naturally, you should edit the settings to suit your hardware and requirements.
IOW, if its ibdata1 that's growing, that's real data, not logging... you need to investigate where all the rows are coming from.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
X utilaziion is growing and growing amirb Linux - Desktop 2 05-28-2007 03:55 AM
Snort database growing large; how to use mysql to delete? logicalfuzz Linux - Software 1 01-12-2006 06:14 PM
My files are growing!!!! Kanon Linux - Newbie 7 11-13-2004 07:26 PM
Growing MySQL footprint robbiemorgan Linux - Newbie 3 09-22-2004 08:37 AM
Growing Up... bkeating General 10 06-17-2002 05:47 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration