MySQL 에서 innodb 를 사용하고 있는데, data file 을 삭제해서 용량을 줄이고 싶습니다.
즉, innodb table space 를 1G 데이터파일 10개를 쓰고 있으며, 그려면
전체 10G 를 사용하고 있습니다. 이제 10G 를 다 쓰지 않아도 되서
용량을 줄이고 싶습니다. 그럴려면 데이터파일을 삭제해야 하는데,
삭제하는 방법이 있는지 알고싶습니다.
Currently, you cannot remove a data file from the tablespace. To decrease the size of your tablespace, use this procedure:
Use mysqldump to dump all your InnoDB tables.
InnoDB
Stop the server.
Remove all the existing tablespace files.
Configure a new tablespace.
Restart the server.
Import the dump files.
If you want to change the number or the size of your InnoDB log files, you have to stop the MySQL server and make sure that it shuts down without errors. Then copy the old log files into a safe place just in case something went wrong in the shutdown and you need them to recover the tablespace. Delete the old log files from the log file directory, edit my.cnf to change the log file configuration, and start the MySQL server again. mysqld sees that no log files exist at startup and tells you that it is creating new ones.
my.cnf