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 |
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 |
You'll need to drop the DB (ie schema) itself as well, or the data dictionary will get confused.
|
...
|
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 |
...
|
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. |
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. |
...
|
All times are GMT -5. The time now is 11:56 PM. |