MySQL "ERROR 1010(HY000):Error dropping database(can
*** 當database '名字'XX 目錄下存在非資料庫檔案時,使用drop database XX時會報ERROR 1010錯誤,解決方案 刪除非資料庫檔案即可再正常drop database XX;
環境如下
①、建立lottery database及lottery下的表
mysql> create database lottery;
Query OK, 1 row affected (0.00 sec)
mysql> use lottery;
Database changed
mysql> create table t_1 (name varchar(10));
Query OK, 0 rows affected (0.00 sec)
mysql> use lottery;
Database changed
mysql> create table t_1 (name varchar(10));
Query OK, 0 rows affected (0.00 sec)
②、檢視lottery database 目錄下檔案
[root@Wonhigh-Test2 lottery]# ll
-rw-rw----. 1 mysql mysql 54 5月 21 11:25 db.opt
-rw-rw----. 1 mysql mysql 8560 5月 21 11:25 t_1.frm
-rw-rw----. 1 mysql mysql 98304 5月 21 11:25 t_1.ibd
-rw-rw----. 1 mysql mysql 54 5月 21 11:25 db.opt
-rw-rw----. 1 mysql mysql 8560 5月 21 11:25 t_1.frm
-rw-rw----. 1 mysql mysql 98304 5月 21 11:25 t_1.ibd
③、建立一個非資料庫檔案的
[root@Wonhigh-Test2 lottery]# touch aa
④、執行drop database
mysql> drop database lottery;
ERROR 1010 (HY000): Error dropping database (can't rmdir './lottery/', errno: 17)
mysql>
⑤、檢視lottery database 下的內容情況... 發現正常的表 已被刪除,非資料庫檔案aa 還在保留
[root@Wonhigh-Test2 lottery]# ll
-rw-r--r--. 1 root root 0 5月 21 11:27 aa
-rw-r--r--. 1 root root 0 5月 21 11:27 aa
⑥、刪除非資料庫檔案aa
[root@Wonhigh-Test2 lottery]# rm -rf aa
⑦、再次執行drop database --OK
mysql> drop database lottery;
Query OK, 0 rows affected (0.00 sec)
mysql>
Query OK, 0 rows affected (0.00 sec)
mysql>
【源於本人筆記】 若有書寫錯誤,表達錯誤,請指正...
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28602568/viewspace-1665786/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- 【MySQL】ERROR 1878 (HY000): Temporary file write failure.MySqlErrorAI
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAError
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- ERROR 1114 (HY000) The table '' is fullError
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- 阿里雲mysql遠端登入報ERROR 2027(HY000)阿里MySqlError
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer
- Error!: SQLSTATE[HY000] [2002] Connection refusedErrorSQL
- 解決ERROR 1030 (HY000): Got error 168 from storage engine apparmorErrorGoAPP
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- MySQL5.7叢集(MGR)啟動報ERROR 3092 (HY000)MySqlError
- MySQL案例02:ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGESMySqlError
- MySQL 使用 show tables 時出現 ERROR 1449 (HY000) 問題MySqlError
- ERROR 1290 (HY000) 解決辦法Error
- mysql 5.6.25報錯ERROR 1372 (HY000): Password hash 的一點思考MySqlError
- mysql無法建立儲存過程問題 ERROR 1307 (HY000)MySql儲存過程Error
- 網站報錯:“Database Server Error”網站DatabaseServerError
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- Centos7-mysql執行報錯ERROR1820(HY000):YoumustresetyourpasswordusingALTERUSERstatementbeforeexecutingthisstatement.CentOSMySqlError
- Linux:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannLinuxErrorMySqlServer
- MySQL 5.7 建立使用者報錯 ERROR 1805 (HY000): Column count of mysql.user is wrongMySqlError
- MySQL建立使用者報錯 ERROR 1396 (HY000): Operation CREATE USER failed for 'afei'@'%'MySqlErrorAI
- mysql Unknown error 1054MySqlError
- ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECTError
- mysql 8 報錯 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryMySqlErrorAIStruct
- mysql錯誤詳解(1819):ERROR 1819 (HY000): Your password does not satisfy the current policy requirementsMySqlErrorUIREM
- Error:Can't connect to SOCKS proxy:Connection refused (Connection refused)Error
- ERROR: failed to establish dependency between database db_name and diskgroupErrorAIDatabase
- SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-preparedSQLError
- MySQL error 錯 誤 碼MySqlError
- [ERROR] mysqld: Can‘t open shared library ‘/usr/local/mysql/lib/plugin/validate_password.so‘ (errno:ErrorMySqlPlugin
- Fatal error: can't check configuration file '/home/watt/proxy/dError