When I run mysql as root and run SHOW DATABASES;
it shows that I have a one_db
database, but when I run DROP DATABASE one_db;
it outputs the following error:
ERROR 1008 (HY000): Can't drop database 'one_db'; database doesn't exist
I then try to CREATE DATABASE one_db;
and outputs this error:
ERROR 1007 (HY000): Can't create database 'one_db'; database exists
How can I delete this database now?
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| one_db |
+--------------------+
4 rows in set (0.00 sec)
mysql> DROP DATABASE one_db;
ERROR 1008 (HY000): Can't drop database 'one_db'; database doesn't exist
mysql> CREATE DATABASE one_db;
ERROR 1007 (HY000): Can't create database 'one_db'; database exists
To fix, can manually cleanup the mysql files relating to the one_db
database :
manual cleanup process
Find the datadir path for mysql by running ( at mysql shell ) :
show variables where Variable_name ='datadir';
Stop mysql server
remove the one_db directory under the 'datadir'
restart mysql server and verify database one_db is not present
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With