{"id":6241,"date":"2021-03-22T15:14:49","date_gmt":"2021-03-22T09:44:49","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6241"},"modified":"2024-12-17T11:34:46","modified_gmt":"2024-12-17T06:04:46","slug":"fixing-the-sql-error-1071","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/fixing-the-sql-error-1071\/","title":{"rendered":"Fixing the SQL error 1071"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Usually, the SQL error occurs if the combined key is too long. You can resolve the SQL error by adjusting the varchar value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As a part of our <a href=\"https:\/\/www.skynats.com\/linux-server-management\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#0274a5\" class=\"has-inline-color\">server management services<\/span><\/a>, we use to fix AWS the SQL error 1071 for the web hosts and online service providers. For further detail information, you can contact our technical team support for any assistance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-resolve-the-sql-error-1071\">How to resolve the SQL error 1071<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the specified key is too long then you will come across a pop-up message error, where the Key length max is 767 bytes\u2019 while running the below query.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE wp_locations (\n`id` INT(11) NOT NULL AUTO_INCREMENT,\n`place` VARCHAR(255) NOT NULL,\n`name` VARCHAR(255) NOT NULL,\nCONSTRAINT `place_name` UNIQUE (`city`, `name`)\n) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here the error is apparent where the combined key is too long. so required to separate the keys or either you have to reduce the column lengths.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generally, MySQL always reserves the max amount for a UTF8 field which is 4 bytes so with 255 + 255 with the DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; this query is over the 767 max key length limit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So we always suggest our clients reduce the length of single varchar or avoid the composite key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Either you can resolve the error by adding&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/my.conf.d directory named umb4-support.cnf\n&#91;mysqld]\ninnodb_large_prefix=true\ninnodb_file_format=barracuda\ninnodb_file_per_table=true\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, restart the SQL service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By this topic, you will get an apparent view to fixing the error 1071 which is mainly caused to the combined key which is too long. You can take our <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#026d9b\" class=\"has-inline-color\">technical team support<\/span><\/a> for any further clarification.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Usually, the SQL error occurs if the combined key is too long. You can resolve the SQL error by adjusting the varchar value. As a part of our server management services, we use to fix AWS the SQL error 1071 for the web hosts and online service providers. For further detail information, you can contact [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-6241","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6241"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6241\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}