Home » Mysql » #1089 – Incorrect prefix key; the used key part isn’t a string, the used length is longer than the key part, or the storage engine doesn’t support unique prefix keys

#1089 – Incorrect prefix key; the used key part isn’t a string, the used length is longer than the key part, or the storage engine doesn’t support unique prefix keys

#1089 – Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys

Some times when we create a Mysql Table we are getting "#1089 – Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys.

change wordpress theme from database

Actually when you create a Primary Key you are telling mysql to create a sub part key* on the first 3 letters of id.

You cannot use some part of a number as a key, you need to use the whole number keys. Also, specifying lengths for numeric types is useless.

So use full length key in Primary key without providing a length.

Now the solution is replace PRIMARY KEY (id(3)))
with PRIMARY KEY (id))

And the final query is below

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">