1

I'm using my Web Application in Godaddy Hosting Server. Php Version is 7.1 and mysql Version is 5.6

while i'm trying

ALTER TABLE aos_products_quotes   
    modify COLUMN discount varchar(255)  DEFAULT 'Percentage' NULL ,  
    modify COLUMN parent_type varchar(255)  NULL ,  
    modify COLUMN parent_id char(255)  NULL ;

these query in my domain sql server its shows

MYSQL #1071 Error Specified Key value is too long

I think i need to use mysql 5.7 or else need to set the global prefix variable is 1..But the Global setting need super privileges..At Godaddy side they told its impossible on Shared hosting..

I try my best about that issue so anyone guide me to solve that issue.. Thanks in advance...

nacho
  • 5,280
  • 2
  • 25
  • 34
Karthik
  • 61
  • 10
  • 2
    Possible duplicate of [#1071 - Specified key was too long; max key length is 767 bytes](https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes) – nacho Oct 24 '17 at 06:54
  • the attempted alterations have made an associated index too long i.e. one or more of those columns is involved in an index which would exceed a limitation if the alteration was implemented. look at the indexes (think "key" as in "primary key") – Paul Maxwell Oct 24 '17 at 07:53

1 Answers1

0

There are many options to fix this:

  1. You can try by changing the character set of columns so that they use less bytes in storage.

  2. You can change / remove indexing of the table. May be you are using composite index whose limit is reached after this alteration.

  3. Try less length of varchar() columns.

share the complete table structure to help you better. Thanks

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81