删除数据库时出错(无法 rmdir '.test\',错误号:17)

2021-11-20 00:00:00 sql mysql phpmyadmin

基本上,我学会了如何使用mysqladmin -u root -p password"命令创建 root 密码,这完全是通过 windows 命令编辑器完成的.现在,下一个过程是显示默认数据库(info.schema、mysql 和 test),这是通过使用SHOW DATABASES;"实现的

Basically, I was taught on how to create a root password using the "mysqladmin -u root -p password" command, this was done all through the windows command editor. Now, the next process was to display the default databases (info. schema, mysql and test) which was achieved by using "SHOW DATABASES;"

但是按照书上的说法,我们不得不删除多余的测试文件,然后弹出如下错误:

But according to the book, we had to delete the redundant test file and the following error pops up:

删除数据库时出错 (Can't rmdir '.test\', errno: 17)

Error Dropping Database (Can't rmdir '.test\', errno: 17)

使用的命令是DROP DATABASE test;

我正在使用 MYSQL 和 PHPMYADMIN.有关如何无错误地删除文件的任何帮助?

I am using MYSQL and PHPMYADMIN. Any help on how to drop the file with no errors?

推荐答案

一个数据库是用数据目录下的一个目录来表示的(通常是/var/lib/mysql),这个目录的目的是用于存储表数据.

A database is represented by a directory under the data directory (usually /var/lib/mysql), and the directory is intended for storage of table data.

DROP DATABASE 语句将删除所有表文件,然后删除代表数据库的目录.但是,它不会删除非表文件,从而无法删除目录.

The DROP DATABASE statement will remove all table files and then remove the directory that represented the database. It will not, however, remove non-table files, whereby making it not possible to remove the directory.

MySQL 无法删除目录时显示错误消息

MySQL displays an error message when it cannot remove the directory

您可以通过删除数据库目录中的任何剩余文件然后删除目录本身来手动删除数据库.

you can really drop the database manually by removing any remaining files in the database directory and then the directory itself.

相关文章