In rare cases, the ibData file size is set too large.

How do you narrow it down?

There are 10 steps


1 mysqldump backup:

mysqldump -uroot -p –single-transaction –master-data=2 –flush-logs –all-databases >/tmp/mysql.sql

2 modify my CNF
3 stop mysqld
4 Delete the data in the Datafile folder. The Datafile folder is not deleted
5 restart mysqld
6 Log in to the mysql database using the default password.

grep password mysqld.log

7 Change the MySQL password:

SET PASSWORD = PASSWORD(‘******’);

8 s ource Imports backup data


9 Log out of mysql and use the old password of the backup file
10 Check whether ibData is shrunk