Remove MySQL ibdata1 without dumping and restoring existing proper databases
Solution 1:
My specific question is: can I leave databases that were created with
innodb_file_per_table
alone? Or will they be destroyed when I remove ibdata1, even though all their files are separate?
The monolithic ibdata1
contains some system-wide data. It is possible you could suffer data loss by trying to delete it manually without getting rid of all your existing databases first.
(There are ways to recover from such a situation, but why put yourself in that position? Follow the instructions you've been given and dump ALL your databases, rebuild your MySQL installation, and reload them. It's the safe choice.)
I can't afford to take this database off-line to dump and reload it.
You're going to have to afford it. It's just one outage - schedule it and make it happen.
Our resident MySQL expert confirms that this is the only (safe) way to shrink ibdata1
and I defer to his expertise in these matters.
(I would also suggest reading his other posts, linked from that answer, before you schedule the outage window. You may as well clean up as many potential problems as you can since you're going to have to take an outage window...)