Make sure your database in phpMyAdmin is empty (no tables, views, routines, or triggers).
If it’s empty and you still get the error, then it’s a filesystem issue.
If you are using XAMPP:
Stop the MySQL server from the XAMPP control panel.
Go to: C:\xampp\mysql\data\
Find the folder with your database name.
Delete that folder manually.
Start MySQL again.
Your database will now be removed.