# How to ignore directories in data dir MySQL 8.0

**URL:** <https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792>\
**Category:** Percona Server for MySQL\
**Created:** [October 28, 2021, 1:25pm UTC](https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792 "2021-10-28T13:25:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ipcmlr](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@ipcmlr](https://forums.percona.com/u/ipcmlr)\
**Post date:** [October 28, 2021, 1:25pm UTC](https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792/1 "2021-10-28T13:25:34Z")

</div>

I upgraded my database to 8.0 and had to remove the ignore-db-dir in the my.cnf file for it to start up.  
When I do a show databases now 2 directories which I don’t have databases in show up.  
lost+found and tmp.  
Is there a way to ignore those directories in mysql 8.0?

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [October 28, 2021, 1:41pm UTC](https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792/2 "2021-10-28T13:41:28Z")

</div>

Hi @ipcmlr - thanks for posting to the Percona forums!

Best practices say you should create a dedicated directory below the root of your mount point. So for example if your root dir was `/mnt/db` you could do something like:

```auto
systemctl stop mysql
mkdir /mnt/db/mysql
chown mysql /mnt/db/mysql
mv -v /mnt/db/<ALL_FILES> /mnt/db/mysql

```

Then update your data directory definition in your `my.cnf` and start up MySQL again. This will ensure you don’t see the lost+found & tmp directories.

---

<div class="post-metadata">

**Author:** ![ipcmlr](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@ipcmlr](https://forums.percona.com/u/ipcmlr)\
**Post date:** [October 28, 2021, 1:49pm UTC](https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792/3 "2021-10-28T13:49:36Z")

</div>

Thanks.  
I’m just doing it the way I’m doing it because it will involve changing monitoring scripts, etc.  
The datadirectory is already called /var/lib/mysql/data but is a sepearet mountpoint.  
So no way around it? Just live with it?

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [October 28, 2021, 2:41pm UTC](https://forums.percona.com/t/how-to-ignore-directories-in-data-dir-mysql-8-0/12792/4 "2021-10-28T14:41:33Z")

</div>

Unfortunately then you’ll have to live with it since you can’t exclude directories from showing up in show databases.  
Well perhaps you could set chmod 700 on the directory `/var/lib/mysql/data/lost+found` but I am not sure how well that would work for filesystem operations
