Hello,
while trying to upload a dictionary to the web app, I get an error. By looking at the logs I see this error message.
[2018-04-16 15:32:28] CSPro API.CRITICAL: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (uncaught exception) at /home/mkaconsu/public_html/csweb/vendor/aura/sql/src/ExtendedPdo.php line 288 {"exception":"[object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes at /home/mkaconsu/public_html/csweb/vendor/aura/sql/src/ExtendedPdo.php:288)"} []
Any ideas how I could solve it?
Thanks in advance
CSWeb SQLSTATE[42000] Specified key was too long
-
- Posts: 6
- Joined: July 18th, 2017, 4:06 pm
CSWeb SQLSTATE[42000] Specified key was too long
- Attachments
-
- 2018-04-16_1746.png (10.37 KiB) Viewed 5644 times
Re: CSWeb SQLSTATE[42000] Specified key was too long
Can you post your dictionary here or send it to us at cspro@lists.census.gov. Also please let us know what version of MySQL you are using.
-
- Posts: 6
- Joined: July 18th, 2017, 4:06 pm
Re: CSWeb SQLSTATE[42000] Specified key was too long
Thank you josh,
My shared hosting uses MySQL 5.6 and PHP 5.6. I attach a screenshot of phpMyAdmin and also the dictionary I am trying to upload. Also, I tried uploading other dictionaries and got the same error.
Thanks again!
My shared hosting uses MySQL 5.6 and PHP 5.6. I attach a screenshot of phpMyAdmin and also the dictionary I am trying to upload. Also, I tried uploading other dictionaries and got the same error.
Thanks again!
- Attachments
-
- ua_splashes.zip
- Dictionary
- (3.9 KiB) Downloaded 280 times
Re: CSWeb SQLSTATE[42000] Specified key was too long
I'm able to use your dictionary with no problem on my test server running MySQL 5.6.35. I'm guessing that there is a difference in our settings for MySQL. If you are able to set startup options for MySQL on your server you could try setting innodb_large_prefix=1 as described here:
https://dev.mysql.com/doc/refman/5.6/en ... rge_prefix
If you are able to upgrade to MySQL 5.7 that should also solve the problem as the index size has been increased by default in that version.
If neither of the above is possible please be patient. We are looking at how to modify the code to reduce the index size to avoid this error.
https://dev.mysql.com/doc/refman/5.6/en ... rge_prefix
If you are able to upgrade to MySQL 5.7 that should also solve the problem as the index size has been increased by default in that version.
If neither of the above is possible please be patient. We are looking at how to modify the code to reduce the index size to avoid this error.
-
- Posts: 6
- Joined: July 18th, 2017, 4:06 pm
Re: CSWeb SQLSTATE[42000] Specified key was too long
My server indeed has the following configuration
I'll contact my shared hosting provider and check if I can do either of those things. I'll post here if this solves the problem.
Thanks a lot josh!
Code: Select all
innodb_large_prefix=OFF
Thanks a lot josh!