Linux : Drop MySQL database return error db.opt Errcode: 13 – Permission denied

By | October 10, 2020

Trying to drop (delete) a MySQL database using CLI and the following error is returned?

ERROR 6 (HY000): Error on delete of ‘./database//db.opt’ (Errcode: 13 – Permission denied)

This is most likely due to permission issue on the database folder or a file within that folder.

Have a look at the MySQL database folder using the following command :

Databases folders should have 750 permissions and owned by the “mysql” user and group, as followed :

If all database folders have the right permissions, investigate further within the folders for any permissions issues on “.frm”, “.myd”, “.myi”, “.csm”, “.csv” and “.ibd” files. They should have 640 permissions and owned by “mysql” user and group, as followed :