S
S
Svobolad2018-02-13 18:51:07
MySQL
Svobolad, 2018-02-13 18:51:07

How to reduce the size of MySQL database (ibdata1 )?

Good afternoon,
I'm interested in the question of how to reduce the size of ibdata1 when using the InnoDB MySQL engine without using innodb_file_per_table (the database is large and serves a critical service that cannot be stopped).
There are many unnecessary tables in the database that I would like to delete, but given the specifics of InnoDB, this will not free up space on the HDD.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2018-02-13
@BorisKorobkov

https://dev.mysql.com/doc/refman/5.7/en/optimize-t...

G
gaidukav, 2020-04-18
@gaidukav

-one. Provided that there are no other databases on this MySQL server, otherwise the following operations will ALSO need to be done with them.
0. Delete all unnecessary data and tables.
1. Convert all tables to MyISAM format. It is necessary to understand - during conversion the table is blocked.
2. stop the server
3. delete files (for MariaDB):
aria_log.00000001
aria_log_control
ib_logfile0
ib_logfile1
ibdata1
4. start the server, deleted files will be automatically created with default sizes
5. reverse convert tables to InnoDB.
--
On the development server with a copy of the combat database, this operation was performed many times,
reduced the "ibdata1" file from 6GB to 1.5GB
What will happen to procedures and triggers - they will probably die, I haven't tried them, I don't have them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question