试图删除数据库,但说数据库不存在,即使我可以使用它
发生这个奇怪的错误我正在尝试清理我没有使用的数据库。然而,当我尝试删除 mysql 时,它说数据库不存在,但我可以使用它!奇怪还是什么?有什么方法可以让我从我的列表中删除这个数据库。
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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个包含用户等的特殊数据库。您不应该删除它,MySQL 也不允许您删除它。
That's a special database containing users, etc. You shouldn't remove it and MySQL isn't letting you.
mysql
数据库保存用户、权限、数据库信息和其他内容。它无法被删除。如果您确实通过删除其关联文件来删除它,您的 mysql 实例将停止运行。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.