LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-24-2009, 11:59 AM   #1
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Rep: Reputation: 16
Mysql: Is it OK to delete ibdata1 under /var/lib/mysql ?


The database has been running for couple months and I noticed the file is growing large to 16GB now.

The information is my database is no more than 1GB. I am wondering can I delete that file directly ?

Any idea is well appreciated.

Thanks,

-Kun
 
Old 09-24-2009, 04:24 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
You cannot delete that file on a running database.

You can delete it if you backup the db, drop all the tables, stop the db, rm the file, restart the db, then restore all the data.

In the future, you can prevent it from getting so large with your db configuration. See: http://dev.mysql.com/doc/refman/5.0/...iguration.html
 
Old 09-24-2009, 07:00 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You'll need to drop the DB (ie schema) itself as well, or the data dictionary will get confused.
 
Old 09-24-2009, 11:36 PM   #4
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:35 PM.
 
Old 09-25-2009, 08:30 PM   #5
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Original Poster
Rep: Reputation: 16
I am trying to backup one database belong to myself in Mysql.

There are other two databases 'mysql' and 'information_schema' created by Mysql when installed.

And 'information_schema' denied my access when I trying to delete that. Is it OK just leave this two database and go ahead to delete that ibdata file ?



Thanks,

-Kun
 
Old 09-25-2009, 11:21 PM   #6
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:35 PM.
 
Old 09-26-2009, 01:35 PM   #7
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Original Poster
Rep: Reputation: 16
Thanks, smartpatrol, mysql command works to restore the data.

But the database I created took no more than 1GB (according to the script created by mysqldump), and there is no other databases besides 'mysql' and 'information_schema' there, so how could that ibdata take 16GB ? It sounds pretty weird.
 
Old 09-26-2009, 01:36 PM   #8
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Original Poster
Rep: Reputation: 16
Thanks, smartpatrol, mysql command works to restore the data.

But the database I created took no more than 1GB (according to the script created by mysqldump), and there is no other databases besides 'mysql' and 'information_schema' there, so how could that ibdata take 16GB ? It sounds pretty weird.
 
Old 09-26-2009, 09:28 PM   #9
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:35 PM.
 
  


Reply



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
MySQL 5.0.67: Unable to install & run. Error /var/lib/mysql/mysql.sock' (2) peteyperson Linux - Server 2 03-04-2009 01:16 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 11:46 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:27 PM.

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