简体   繁体   English

MySQL-从失败的放置数据库中恢复

[英]MySQL - Recovering from failed drop database

Ok, so I had a very large (40GB) database containing 1 table. 好的,所以我有一个很大的(40GB)数据库,其中包含1个表。 I went to the Windows MySQL command prompt and typed: 我转到Windows MySQL命令提示符并键入:

drop database very_large_db;

I waited a few minutes and it came back with an error. 我等了几分钟,然后又出现错误。 I'm sorry but I forgot to record the error number. 抱歉,我忘了记录错误号。 It then tried to reconnect and was unable to re-connect to the MySQL command prompt. 然后,它尝试重新连接,但无法重新连接到MySQL命令提示符。 I then rebooted the computer, went back to the command prompt, and tried to drop the database again. 然后,我重新启动了计算机,回到命令提示符,然后尝试再次删除该数据库。 At this point, it just kicked me out and the MySQL service stopped (verified in services.msc). 在这一点上,它把我踢了出去,并且MySQL服务停止了(在services.msc中验证)。 Next, I decided to go to the MySQL data directory in Windows Explorer and manually delete the database directory. 接下来,我决定转到Windows资源管理器中的MySQL数据目录,并手动删除数据库目录。 It deleted no problem, and when I perform a "show databases;" 它删除没有问题,并且当我执行“显示数据库”时; command in the MySQL command prompt, it is no longer there. MySQL命令提示符中的命令,它不再存在。

Is there anything else I need to do to make sure the database was properly deleted? 我还需要执行其他任何操作来确保正确删除数据库吗? Is there any chance I corrupted any other databases in MySQL? 我有可能破坏MySQL中的任何其他数据库吗?

Thanks 谢谢

Deleting the directory is equivalent to DROP TABLE. 删除目录等效于DROP TABLE。 Try this: create a sub-directory in data and run 'SHOW DATABASES;' 试试这个:在数据中创建一个子目录并运行“ SHOW DATABASES;”。 you'll see that MySQL just considers the directory to be a database. 您会看到MySQL只是将目录视为数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM