Mysql warning: InnoDB: Ignoring tablespace `foo`.`bar` because the DISCARD flag is set
Why this warning pops up:

You discarded the tablespace and physically removed the .frm file from the data directory. But still, tablespace information is present in the InnoDB data dictionary table. (you can check innodb_sys_tables, innodb_sys_tablespace in information schema).

So whenever the server starts up, InnoDB tries to load all the table present in sys_tables, sys_tablespaces.  So it tries to open foo.bar table but the state is DISCARD. So that warning is issued.

How to remove the table/warning:


Create a fake bar.frm &amp; bar.ibd inside the foo folder of data
directory.
Start the server and give the drop table foo.bar. It
should remove the table from the dictionary and removes the warning too.