MySQL 语法错误或访问冲突:1059 标识符名称太长
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13133517/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Syntax error or access violation: 1059 Identifier name is too long
提问by vinoth kumar
I receive a MySQL error when I create a table:
我在创建表时收到 MySQL 错误:
SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'FK_SALES_FLAT_CREDITMEMO_GRID_ARCHIVE_STORE_ID_CORE_STORE_STORE_ID' is too long
How can the default Identifier name size be increased or how can I solve this otherwise?
如何增加默认标识符名称大小,否则我该如何解决?
回答by Michael
Please take a look at http://dev.mysql.com/doc/refman/5.5/en/identifiers.html- you are limited to 64 chars to an identifier.
请查看http://dev.mysql.com/doc/refman/5.5/en/identifiers.html- 标识符限制为 64 个字符。
回答by Muzammil Hussain
Provide your own shot name to key.
提供您自己的镜头名称以进行抠像。
$table->unique(['product_id', 'company_id', 'price', 'delivery_hours'], 'prices_history_index_unique');