MySQL: reducing ibdata file size for MyISAM tables

后端 未结 2 686
花落未央
花落未央 2021-01-19 07:33

My Question is actually very similar to this one and also includes a good answer for a case with InnoDB Engine tables:

https://dba.stackexchange.com/questions/8982/i

2条回答
  •  被撕碎了的回忆
    2021-01-19 08:10

    As mentioned MyISAM shouldn't be using ibdata. What are your innodb settings in your my.cnf, or in the MySQL shell type:

        SHOW VARIABLES LIKE "%innodb%";
    

    Are these variables set?

        innodb_data_home_dir
        innodb_data_file_path
    

    If you are not using INNODB at all you should be able to safely remove the ibdata and ib_logfile(s) and restart MySQL. Normally though removing these without dropping the tables first will cause issues. See How to shrink/purge ibdata1 file in MySQL

    If you do have a MyISAM table over 5Gigs, it's recommended that you use INNODB anyway. (Anything over 4 Gigs). To troubleshoot you could try and add

        skip-innodb 
    

    in the my.cnf if you are not using INNODB at all.

提交回复
热议问题