0

Got this weird error happening I am trying to clean up my databases that I am not using. however when I try to drop mysql it says database dosnt exists, however I can use it!! weird or what?! any way for me to get rid of this database from my list.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> use test;
Database changed
mysql> drop mysql;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql' at line 1
mysql> drop database mysql;
ERROR 1146 (42S02): Table 'mysql.proc' doesn't exist
mysql> create database mysql;
ERROR 1007 (HY000): Can't create database 'mysql'; database exists
mysql> 
OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
C.Johns
  • 10,185
  • 20
  • 102
  • 156

2 Answers2

6

That's a special database containing users, etc. You shouldn't remove it and MySQL isn't letting you.

Joshua Martell
  • 7,074
  • 2
  • 30
  • 37
0

The mysql database holds users, permissions, database information and other things. It cannot be removed. If you did manage to remove it by deleting its associated files, your mysql instance would cease to function.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390