I'm getting the
#1089 - Incorrect prefix key
error and can't figure out what I'm doing wrong. Help, please!sandorfalotsandorfalot
11 Answers
In your PRIMARY KEY definition you've used
(id(11))
, which defines a prefix key - i.e. the first 11 characters only should be used to create an index. Prefix keys are only valid for CHAR
, VARCHAR
, BINARY
and VARBINARY
types and your id
field is an int
, hence the error.Pop-up sering muncul setiap lima menit untuk menyarankan kita mendaftar. Namun untuk keseluruhan toolsnya, Lucidpress juga tidak kalah menariknya dengan yang lain. Itulah beberapa aplikasi yang dapat dijadikan untuk membantu membuat brosur, silahkan dipilih sesuai dengan selera. Sep 06, 2014 Cara Membuat Popup Login Form di jQuery Mobile Lihat tutorial lainnya di http://dumetschool.com/blog.
Use
PRIMARY KEY (id)
instead and you should be fine.MySQL reference here and read from paragraph 4.
user1864610
If you are using a GUI and you are still getting the same problem. Just leave the size value empty, the primary key defaults the value to 11, you should be fine with this. Worked with Bitnami phpmyadmin.
RalphkayRalphkay
This
PRIMARY KEY (
id
(11))is generated automatically by phpmyadmin, change to
PRIMARY KEY (
id
).
Rafael Helizio Serrate ZagoRafael Helizio Serrate Zago
There is a simple way of doing it. This may not be the expert answer and it may not work for everyone but it did for me.
Uncheck all primary and unique check boxes, jut create a plain simple table.
When phpmyadmin (or other) shows you the table structure, make the column primary by the given button.
Then click on change and edit the settings of that or other colums like 'unique' etc.
Robot BoyRobot Boy
Roshan PadoleRoshan Padole
Community♦
Issac NguyenIssac Nguyen
![Popup Popup](http://3.bp.blogspot.com/-yldhqqbld-Y/TzERvSrKWwI/AAAAAAAAAsA/yK-rJjQscrw/s1600/save-as-password.jpg)
When you give id as a primary key then a pop up is come and those aske you to how many size of this primary key.So you just leave blank because by default int value is set 11. Click then ok on those pop up without any enter a number.in this type of error never will you face in future.Thank you ?
hemant raohemant rao
Problem is the same for me in phpMyAdmin. I just created a table without any const. Later I modified the ID to a Primary key. Then I changed the ID to Auto-inc. That solved the issue.
ArindamArindam
In my case, i faced the problem while creating table from phpmyadmin. For id column i choose the primary option from index dropdown and filled the size 10.
If you're using phpmyadmin, to solve this problem change the index dropdown option again, after reselecting the primary option again it'll ask you the size, leave it blank and you're done.
sh6210sh6210
according to the latest version of MySQL (phpMyAdmin), add a correct INDEX while choosing primary key. for example: id[int] INDEX 0 ,if id is your primary key and at the first index. Or,
For your problem try this one
Omar FarukOmar Faruk
I also had this same problem.
Solution work for me:
Solution work for me:
I paste this code in SQL and run, it works fine.
sayalisayali
protected by Community♦Feb 1 '18 at 16:57
![Pop Pop](http://www.ilmuwebsite.com/wp-content/uploads/2011/09/images-800x640.jpeg)
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?