Editing
Troubleshooting of MySQL errors
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Database and Table Operation Errors == === ERROR 1005 (HY000) at line xx: Can't create table 'TABLE_NAME' (errno: 28) === Solutions * Check if the disk space where mysql data folder located is enough. e.g. Input {{kbd | key=df -h}} on {{Linux}} * More on [http://stackoverflow.com/questions/11045279/error-1005-hy000-cant-create-table-errno-150 mysql - ERROR 1005 (HY000): Can't create table (errno: 150) - Stack Overflow]. === ERROR 1006 (HY000): Can't create database 'DATABASE_NAME' (errno: 28) === Solutions * Check if the disk space where mysql data folder located is enough. e.g. Input {{kbd | key=df -h}} on {{Linux}} * More on [http://stackoverflow.com/questions/18719748/error-1006-hy000-cant-create-database-errno-13-mysql-5-6-12 ERROR 1006 (HY000) Can't create database (errno: 13) MySQL 5.6.12 - Stack Overflow]. === ERROR 1010: Error dropping database (can't rmdir) === Message: <pre>Error dropping database (can't rmdir '.\<db_name>\', errno: 17)</pre> Solution * Manually delete the leftover non-MySQL files (e.g. .sql files) inside the database directory, then retry DROP DATABASE — or simply delete the entire folder manually. Root Cause * MySQL's DROP DATABASE only removes files it manages. Foreign files left in the data directory (such as .sql dumps) prevent rmdir from removing the folder, causing errno 17 (ENOTEMPTY). === ERROR 1017 - Can't find file: '.\DATABASE\TABLE.frm' (errno: 22 - Invalid argument) === Message: [Err] 1017 - Can't find file: '.\DATABASE\TABLE.frm' (errno: 22 - Invalid argument) Solutions * Check the existence of file DATABASE\TABLE.frm. If not, you may need to create the TABLE before executed the MySQL query. * Check the permission of file DATABASE\TABLE.frm or folder which the file located<ref>[http://stackoverflow.com/questions/12106727/mysql-copying-tables-files-gives-rise-to-error-1017-hy000-cant-find-file MySQL, copying tables files gives rise to "ERROR 1017 (HY000): Can't find file:" even though its there there - Stack Overflow]</ref><ref>[https://www.percona.com/forums/questions-discussions/mysql-and-percona-server/2762-error-1017-hy000-can-t-find-file ERROR 1017 (HY000): Can't find file - Percona Community]</ref>. ''unverified'' === Navicat error: Field doesn't have a default value === <pre> [ERR] 1364 - Field 'source' doesn't have a default value </pre> Solution: * When importing from Excel to a database, if the 'source' field is empty or not specified, it's necessary to assign a value to the 'source' field. Alternatively, modify the field definition to allow the field value to be NULL. === ERROR 1813: Tablespace for table xxx exists === Message: ERROR 1813 Tablespace for table xxx exists. Solution * [https://stackoverflow.com/questions/15694168/error-tablespace-for-table-xxx-exists-please-discard-the-tablespace-before-imp mysql - Error: Tablespace for table xxx exists. Please DISCARD the tablespace before IMPORT - Stack Overflow] === ERROR 1690 - BIGINT UNSIGNED value is out of range === Message: MySQL error #1690 (BIGINT UNSIGNED value is out of range) Solution <ref>[https://dev.mysql.com/doc/refman/8.0/en/out-of-range-and-overflow.html MySQL :: MySQL 8.0 Reference Manual :: 11.2.6 Out-of-Range and Overflow Handling]</ref><ref>[https://stackoverflow.com/questions/34115917/mysql-error-1690-bigint-unsigned-value-is-out-of-range-for-unix-timestamp MySQL error #1690 (BIGINT UNSIGNED value is out of range) for UNIX_TIMESTAMP() - Stack Overflow]</ref>: <pre> SET sql_mode = 'NO_UNSIGNED_SUBTRACTION'; </pre> === ERROR 1305 - FUNCTION MY_TABLE.MY_FUNCTION does not exist === Message: MySQL error 1305 - FUNCTION MY_TABLE.MY_FUNCTION does not exist Solution: Fix the typo in the function name === ERROR 1170: BLOB/TEXT column 'url' used in key specification without a key length === Condition * SQL syntax when tried to create the new table <pre> DROP TABLE IF EXISTS `my_table`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `my_table` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `url` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(2) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`job_id`), UNIQUE KEY `url` (`url`) USING HASH ) ENGINE=InnoDB AUTO_INCREMENT=3573 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; </pre> Solution: BLOB/TEXT column 'url' used in key specification with a key length e.g. {{kbd | key=`url`(500)}} <pre> DROP TABLE IF EXISTS `my_table`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `my_table` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `url` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(2) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`(500)) ) ENGINE=InnoDB AUTO_INCREMENT=3573 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; </pre>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information