If you have a huge ibdata1 file (/var/lib/mysql/ibdata1) probably is because you don’t have innodb_file_per_table option in your my.cnf. To fix this follow this simple method (it requires to have free disk space):

For each table execute this:ALTER TABLE `table_name` ENGINE=InnoDB
With that the table will be regenerated in its own file. But ibdata1 won’t shrink because MySQL is greedy and will keep that (empty) space for him