du -sh * show significant more used space that ls -lah
Solution 1:
It seems that you have a misunderstanding about what you are being told. The ls -lah
command lists the contents of the current directory. In this particular case that's /var/lib/mysql
. Amongst other things you were told this
drwx------ 2 mysql mysql 16K Dec 30 2015 database_xyz
You are misunderstanding what this is telling you.
You can consider a directory to be like a flat file containing a list of directory entries. (simply) A directory entry is a file name and a pointer to where that file resides on disk. This information takes up disk space.
What
drwx------ 2 mysql mysql 16K Dec 30 2015 database_xyz
is telling you is that there is a directory entry in /var/lib/mysql
called database.xyz
. That entry is for a file type d
which indicates it is a directory and amongst other things the size of the directory 'file' is 16K.
Solution 2:
To know the size of database_xyz file only just type
du -sh database_xyz
you will find the exact result