19
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

肥大化したibdata1を縮小する

Last updated at Posted at 2014-07-23

参考:[MySQL] ibdata1のサイズを削減する手順 [InnoDB] | oshiireBLOGoshiireBLOG

  • /var/lib/mysql/ibdata1
念のため全バックアップ
mysqldump -uroot -p --opt --all-databases > alldb.sql
mysqlを停止してファイルを移動し起動
/etc/init.d/mysql stop
cd /var/lib/mysql
ファイル削除
rm ib_logfile[01] ibdata1
mysql起動
/etc/init.d/mysql start

/var/lib/mysql/ を削除する場合

  • どうも調子が悪い場合は以下実施
    • rm -r /var/lib/mysql/database名/
mysql -uroot -p < allldb.sql
sudo -u mysql mysql_install_db
19
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?