mysql - 在 Mysql 数据库中删除搞砸的表

标签 mysql mysqladministrator

我设法破坏了(或其他)我拥有的 mysql 数据库中的“ session ”表(称为“e_learning_resource_prelive”)。这通常不是问题,因为我可以返回到数据库的备份转储。但是,损坏的表似乎阻止了我删除数据库:

> mysqladmin -u root drop e_learning_resource_prelive
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'e_learning_resource_prelive' database [y/N] y
mysqladmin: DROP DATABASE e_learning_resource_prelive failed;
error: 'Unknown table 'sessions''

当我进入数据库时​​, session 表显示在 show_tables 中(它是那里唯一的一个,mysqladmin drop 删除了其余的)但我不能删除它:

mysql> show tables;
+---------------------------------------+
| Tables_in_e_learning_resource_prelive |
+---------------------------------------+
| sessions                              | 
+---------------------------------------+
1 row in set (0.00 sec)

mysql> drop table sessions;
ERROR 1051 (42S02): Unknown table 'sessions'

谁能告诉我如何删除这个表或整个数据库?我需要删除数据库,然后从我的备份转储中重建它。

最佳答案

想通了,现在看起来有点明显了。 dbs 都只有一个文件夹,可以像其他任何东西一样删除。

sudo rm -r/var/lib/mysql/e_learning_resource_prelive

无论如何,感谢所有看过的人 :) 最大

关于mysql - 在 Mysql 数据库中删除搞砸的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2008628/

相关文章:

javascript - 未处理的拒绝 TypeError : Cannot read property 'username' of null

mysql - MySQL 中 SYSDATE()、NOW()、CURRENT_TIMESTAMP、CURRENT_TIMESTAMP() 的区别?

mysql - 如果表中的所有列都是某个唯一键的一部分,可以吗?

mysql - MySQL 管理中奇怪的模式行为

mysqld : Could not create or access the registry key needed for the MySQL application to log to the Windows EventLog

mysql - 如何在 where 子句中优化 mysql 中的日期时间比较

php - 如何在php文件中插入$date1和$date2

MySQL新用户权限不起作用

mysql - mysql打开文件和打开文件的区别