Ошибка 1089 phpmyadmin

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(11))
) ENGINE = MyISAM;

I’m getting the #1089 - Incorrect prefix key error and can’t figure out what I’m doing wrong.

Dharman's user avatar

Dharman

31.1k25 gold badges87 silver badges137 bronze badges

asked Mar 8, 2015 at 21:47

sandorfalot's user avatar

2

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.

Use PRIMARY KEY (id) instead and you should be fine.

MySQL reference here and read from paragraph 4.

answered Mar 8, 2015 at 21:58

0

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.

answered Sep 18, 2015 at 23:20

Raphael Amponsah's user avatar

1

This

PRIMARY KEY (id (11))

is generated automatically by phpmyadmin, change to

PRIMARY KEY (id)

.

answered Apr 17, 2016 at 2:19

Rafael Helizio Serrate Zago's user avatar

0

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.

answered Aug 5, 2015 at 12:40

Robot Boy's user avatar

Robot BoyRobot Boy

1,8561 gold badge17 silver badges17 bronze badges

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(11))
) ENGINE = MyISAM;

Change To

CREATE TABLE `table`.`users` (
        `id` INT(11) NOT NULL AUTO_INCREMENT,
        `username` VARCHAR(50) NOT NULL,
        `password` VARCHAR(50) NOT NULL,
        `dir` VARCHAR(100) NOT NULL,
        PRIMARY KEY (`id`)
    ) ENGINE = MyISAM;

answered Mar 3, 2017 at 16:16

Roshan Padole's user avatar

Here the full solution step by step

  • First of all you have to make the table by inserting all the data. id should AI ticked.
  • then press go and #1089 error will be pop-up

here is the solution

  • theres a button near go called preview SQL
  • click that button and copy the sql code
  • then click on SQL tab on top of the window
  • Clear the text filed and paste that copied code there.
  • you will be see (id (11)) this on bottom of the code
  • replace (id (11)) into (id)
  • and click go

boom now you will be fine

answered Oct 22, 2019 at 16:06

Malith Ileperuma's user avatar

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.

answered Oct 23, 2018 at 17:05

sh6210's user avatar

sh6210sh6210

4,2101 gold badge37 silver badges27 bronze badges

It works for me:

CREATE TABLE `users`(
    `user_id` INT(10) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(255) NOT NULL,
    `password` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`user_id`)
) ENGINE = MyISAM;       

Community's user avatar

answered Sep 16, 2015 at 13:29

Issac Nguyen's user avatar

1

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 😊

answered Jun 30, 2017 at 3:37

hemant rao's user avatar

hemant raohemant rao

2,2832 gold badges13 silver badges14 bronze badges

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.

ALTER TABLE `users` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT;

Francisco's user avatar

Francisco

10.9k6 gold badges34 silver badges45 bronze badges

answered Apr 7, 2017 at 7:28

Arindam's user avatar

ArindamArindam

6758 silver badges16 bronze badges

I also had this same problem.
Solution work for me:

CREATE TABLE IF NOT EXISTS `users` (
  `sr_no` int(11) NOT NULL AUTO_INCREMENT,
  `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
  PRIMARY KEY (`sr_no`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

I paste this code in SQL and run, it works fine.

answered Aug 23, 2016 at 12:06

sayali's user avatar

1

In PHPMyAdmin, Ignore / leave the size value empty on the pop-up window.

answered Oct 27, 2020 at 16:34

Engr. Kazi Shahadat Hossain's user avatar

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

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE = MyISAM;

Adowrath's user avatar

Adowrath

70111 silver badges24 bronze badges

answered Sep 17, 2015 at 10:32

Omar Faruk's user avatar

Omar FarukOmar Faruk

3892 silver badges8 bronze badges

1

This worked for me:

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(id))
) ENGINE = MyISAM;

No need to put id(11) because, by default, it is equal to 11 so you leave
it as id and in phpmyadmin you leave it empty.

Nick's user avatar

Nick

4,85418 gold badges31 silver badges47 bronze badges

answered May 5, 2021 at 16:51

twizelissa's user avatar

Drop the table.user and just use user
The lenght of the id was alread specified in the
id INT(11) and does not need to be specified in the PRIMART KEY.

CREATE TABLE users
(
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
dir VARCHAR(100) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE = MyISAM;

answered Nov 6, 2022 at 7:11

Nexpulse's user avatar

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(11))
) ENGINE = MyISAM;

I’m getting the #1089 - Incorrect prefix key error and can’t figure out what I’m doing wrong.

Dharman's user avatar

Dharman

31.1k25 gold badges87 silver badges137 bronze badges

asked Mar 8, 2015 at 21:47

sandorfalot's user avatar

2

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.

Use PRIMARY KEY (id) instead and you should be fine.

MySQL reference here and read from paragraph 4.

answered Mar 8, 2015 at 21:58

0

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.

answered Sep 18, 2015 at 23:20

Raphael Amponsah's user avatar

1

This

PRIMARY KEY (id (11))

is generated automatically by phpmyadmin, change to

PRIMARY KEY (id)

.

answered Apr 17, 2016 at 2:19

Rafael Helizio Serrate Zago's user avatar

0

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.

answered Aug 5, 2015 at 12:40

Robot Boy's user avatar

Robot BoyRobot Boy

1,8561 gold badge17 silver badges17 bronze badges

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(11))
) ENGINE = MyISAM;

Change To

CREATE TABLE `table`.`users` (
        `id` INT(11) NOT NULL AUTO_INCREMENT,
        `username` VARCHAR(50) NOT NULL,
        `password` VARCHAR(50) NOT NULL,
        `dir` VARCHAR(100) NOT NULL,
        PRIMARY KEY (`id`)
    ) ENGINE = MyISAM;

answered Mar 3, 2017 at 16:16

Roshan Padole's user avatar

Here the full solution step by step

  • First of all you have to make the table by inserting all the data. id should AI ticked.
  • then press go and #1089 error will be pop-up

here is the solution

  • theres a button near go called preview SQL
  • click that button and copy the sql code
  • then click on SQL tab on top of the window
  • Clear the text filed and paste that copied code there.
  • you will be see (id (11)) this on bottom of the code
  • replace (id (11)) into (id)
  • and click go

boom now you will be fine

answered Oct 22, 2019 at 16:06

Malith Ileperuma's user avatar

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.

answered Oct 23, 2018 at 17:05

sh6210's user avatar

sh6210sh6210

4,2101 gold badge37 silver badges27 bronze badges

It works for me:

CREATE TABLE `users`(
    `user_id` INT(10) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(255) NOT NULL,
    `password` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`user_id`)
) ENGINE = MyISAM;       

Community's user avatar

answered Sep 16, 2015 at 13:29

Issac Nguyen's user avatar

1

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 😊

answered Jun 30, 2017 at 3:37

hemant rao's user avatar

hemant raohemant rao

2,2832 gold badges13 silver badges14 bronze badges

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.

ALTER TABLE `users` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT;

Francisco's user avatar

Francisco

10.9k6 gold badges34 silver badges45 bronze badges

answered Apr 7, 2017 at 7:28

Arindam's user avatar

ArindamArindam

6758 silver badges16 bronze badges

I also had this same problem.
Solution work for me:

CREATE TABLE IF NOT EXISTS `users` (
  `sr_no` int(11) NOT NULL AUTO_INCREMENT,
  `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
  PRIMARY KEY (`sr_no`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

I paste this code in SQL and run, it works fine.

answered Aug 23, 2016 at 12:06

sayali's user avatar

1

In PHPMyAdmin, Ignore / leave the size value empty on the pop-up window.

answered Oct 27, 2020 at 16:34

Engr. Kazi Shahadat Hossain's user avatar

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

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE = MyISAM;

Adowrath's user avatar

Adowrath

70111 silver badges24 bronze badges

answered Sep 17, 2015 at 10:32

Omar Faruk's user avatar

Omar FarukOmar Faruk

3892 silver badges8 bronze badges

1

This worked for me:

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(id))
) ENGINE = MyISAM;

No need to put id(11) because, by default, it is equal to 11 so you leave
it as id and in phpmyadmin you leave it empty.

Nick's user avatar

Nick

4,85418 gold badges31 silver badges47 bronze badges

answered May 5, 2021 at 16:51

twizelissa's user avatar

Drop the table.user and just use user
The lenght of the id was alread specified in the
id INT(11) and does not need to be specified in the PRIMART KEY.

CREATE TABLE users
(
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
dir VARCHAR(100) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE = MyISAM;

answered Nov 6, 2022 at 7:11

Nexpulse's user avatar

CREATE TABLE `movies`.`movie`
( `movie_id` INT(3) NULL AUTO_INCREMENT, `movie_name` VARCHAR(25) NULL,
  `movie_embedded_id` VARCHAR(50) NULL, `rating_no` INT(3) NULL,
  `movie_description` VARCHAR(50) NULL, PRIMARY KEY (`movie_id`(3))) ENGINE = InnoDB;

I keep getting this error:

#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.

but I’ve got no idea what it means, anyone have a clue?

Sevvlor's user avatar

Sevvlor

5601 gold badge7 silver badges24 bronze badges

asked May 22, 2015 at 21:22

tinOfBeans's user avatar

2

With the part

PRIMARY KEY (`movie_id`(3))

you are telling mysql to create a sub part key* on the first 3 Bytes of movie id. This only works for string types.

You need to use

PRIMARY KEY (`movie_id`)

without providing a length.

*Is this sure the query resulting in the error? Never saw that on a primary key, its used for indexes.

answered May 22, 2015 at 21:31

dognose's user avatar

dognosedognose

20.4k9 gold badges61 silver badges107 bronze badges

1

after selecting PRIMARY KEY when you create table, don’t input any value in pop dialog

answered Apr 28, 2018 at 1:53

Albert Nguyen's user avatar

2

You can also get this error when creating an index if you specify a prefix length that is longer than the length of the actual column. If you tried to create an index containing someColumn(20) but in the table someColumn is VARCHAR(15), then this error will occur.

answered Feb 25, 2018 at 18:30

Wandering Zombie's user avatar

For the primary key do not enter any length of type.

Example:
int()

answered Dec 26, 2022 at 13:19

Chandan Sharma's user avatar

I faced the same error, after create in new tab with id column which I want to set 11 length as int type. I just edited and run manually the generated query for creating table then it is created.
Old version like this:

CREATE TABLE `demo_db`.`products` 
(
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT , 
`name` VARCHAR(100) NOT NULL , 
`note` VARCHAR(1500) NOT NULL 
PRIMARY KEY (`id`(11))
) ENGINE = InnoDB;

Then I updated as follow

CREATE TABLE `demo_db`.`products` 
(
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT , 
`name` VARCHAR(100) NOT NULL , 
`note` VARCHAR(1500) NOT NULL 
PRIMARY KEY (`id`)
) ENGINE = InnoDB;

answered Aug 25 at 22:55

Yusif Karimov's user avatar

11 ответов

В определении PRIMARY KEY вы использовали (id(11)), который определяет префиксный ключ — то есть первые 11 символов должны использоваться только для создания индекса. Префиксные ключи действительны только для типов CHAR, VARCHAR, BINARY и VARBINARY, а поле idint, следовательно, ошибка.

Используйте PRIMARY KEY (id), и все будет в порядке.

Ссылка MySQL здесь и прочитайте из параграфа 4.

user1864610

Поделиться

Если вы используете графический интерфейс, и вы по-прежнему получаете ту же проблему. Просто оставьте значение размера пустым, первичный ключ по умолчанию имеет значение 11, с этим вы должны быть в порядке. Работал с Bitnami phpmyadmin.

Ralphkay

Поделиться

Это

ПЕРВИЧНЫЙ КЛЮЧ (id (11))

автоматически генерируется phpmyadmin, изменяется на

ПЕРВИЧНЫЙ КЛЮЧ (id)

.

Rafael Helizio Serrate Zago

Поделиться

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`(11))
) ENGINE = MyISAM;

Изменить на

CREATE TABLE `table`.`users` (
        `id` INT(11) NOT NULL AUTO_INCREMENT,
        `username` VARCHAR(50) NOT NULL,
        `password` VARCHAR(50) NOT NULL,
        `dir` VARCHAR(100) NOT NULL,
        PRIMARY KEY (`id`)
    ) ENGINE = MyISAM;

Roshan Padole

Поделиться

Существует простой способ сделать это. Это может быть не экспертный ответ, и он может работать не для всех, но для меня это было.

Снимите флажки всех основных и уникальных флажков, создайте простую таблицу.

Когда phpmyadmin (или другое) показывает структуру таблицы, сделайте столбец основной данной кнопкой.

Затем нажмите изменить и отредактируйте настройки тех или иных колонок, таких как «уникальный» и т.д.

Robot Boy

Поделиться

Проблема для меня в phpMyAdmin. Я просто создал таблицу без const.
Позже я изменил идентификатор на главный ключ. Затем я изменил идентификатор на Auto-inc.
Это решило проблему.

ALTER TABLE `users` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT;

Arindam

Поделиться

Это работает для меня:

CREATE TABLE `users`(
    `user_id` INT(10) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(255) NOT NULL,
    `password` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`user_id`)
) ENGINE = MyISAM;       

Issac Nguyen

Поделиться

Когда вы указываете id в качестве первичного ключа, появляется всплывающее окно, и они спрашивают вас, сколько размеров этого первичного ключа.
Таким образом, вы просто оставляете пустым, потому что по умолчанию установлено значение int. 11. Нажмите «ОК» на всплывающих окнах без ввода числа.
в этом типе ошибок вы никогда не столкнетесь в будущем.
Спасибо,

hemant rao

Поделиться

В моем случае я столкнулся с проблемой при создании таблицы из phpmyadmin. Для столбца id я выбираю основной вариант из раскрывающегося списка индекса и заполняю размер 10.

Если вы используете phpmyadmin, для решения этой проблемы снова измените параметр раскрывающегося списка индекса, после повторного выбора первичного параметра он попросит вас об этом, оставьте его пустым, и все готово.

sh6210

Поделиться

У меня также была такая же проблема.
Решение для меня:

CREATE TABLE IF NOT EXISTS 'users' (
  'sr_no' int(11) NOT NULL AUTO_INCREMENT,
  'username' VARCHAR(50) NOT NULL,
    'password' VARCHAR(50) NOT NULL,
    'dir' VARCHAR(100) NOT NULL,
  PRIMARY KEY ('sr_no')
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

Я вставляю этот код в SQL и запускаю, он отлично работает.

sayali

Поделиться

в соответствии с последней версией MySQL (phpMyAdmin), добавьте правильный ИНДЕКС при выборе первичного ключа. например: id [int] INDEX 0, если id — ваш первичный ключ и первый индекс.
Или


Для вашей проблемы попробуйте этот

CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE = MyISAM;

Omar Faruk

Поделиться

Ещё вопросы

  • 0Разбор HTML от определенной начальной точки до определенной конечной точки?
  • 0Могу ли я работать с 4 int32_t, содержащимися в __m128i?
  • 1Как вы печатаете сообщение об ошибке при попытке ввести отрицательное значение в массив?
  • 1Добавление столбца в фрейм данных на основе ранга значений в предыдущих столбцах
  • 0Ошибка C ++ LNK2019
  • 1Как я могу определить атрибуты ребер или вершин с помощью Юнга?
  • 0Лучший способ для двух последовательных таблиц SELECT
  • 0Angular Grid (ag-grid) показать / скрыть не работает
  • 0Перезагрузить таблицу без обновления всей страницы в php
  • 0плагин проверки jquery, условный удаленный вызов не работает должным образом
  • 1Ткинтер лучшие фоны
  • 0как скользить изображения в угловых JS?
  • 0MySQL выбирает одно значение из таблицы, если есть два языка [дубликата]
  • 1бритва PDF становится пустым в MVC4
  • 0Изменение переменной контроллера с завода. AngularJS
  • 0Как я могу получить и установить выбранный переключатель во внешнем HTML-контенте с помощью ActionScript?
  • 1Функция apply (), вызываемая на Function.prototype.bind в JavaScript?
  • 2WildFly: ошибка при запуске
  • 1Загрузка файлов с помощью ExtJS и Jersey
  • 0Кнопка проверки ngCart всегда 404с
  • 1Понимание методов. Java-код
  • 1Каков наилучший способ построить набор объектов динамической длины в Java?
  • 1Как я могу обрабатывать изображения с OpenCV параллельно, используя многопроцессорность?
  • 1Razor DropDownListFor SelectList, как связать неисчислимые селекты или как это сделать?
  • 1gridworld помогают движущимся твари открыть место
  • 0Вставить несколько столбцов JSON в MySQL (используя API)
  • 0Как представить отношения один-ко-многим в JSON с помощью Php?
  • 0Что означает выбор * во вкладке «Администрирование-клиент» рабочей среды
  • 1Когда перезапускается viewpager, он продолжает выполнять предыдущий фрагмент
  • 1Захват функций с помощью регулярных выражений
  • 0преобразование текста: полная ширина не работает в Опере — HTML
  • 1Вывод значений из списка ключей с помощью SQLAlchemy, Jinja2 и Flask
  • 1OSMnx Получить координаты Lat Lon чистых узлов пересечения
  • 1Как добавить родной андроид проект, чтобы реагировать на родной?
  • 0Как отправить форму с угловым в MVC?
  • 0Как ждать дочерней директивы рендера?
  • 1Возможно ли, что getInstallerPackageName () имеет значение null, когда приложение загружено из Google Play Store?
  • 0Twitter с SSL с использованием cURL в PHP
  • 0Как я могу заполнить HTML-таблицу из локального текстового файла?
  • 0IE слишком медленный при добавлении большого количества HTML в DOM через Javascript
  • 0тип документа не допускает здесь элемент «BR»; при условии отсутствия стартового тега «LI»
  • 0GCC не разрешается автоматически .cpp из класса .h include
  • 1Не получать данные из кеша сессии, вместо этого попадать в БД
  • 0Как использовать выражение Angularjs в пружине MVC?
  • 0Передача массива в качестве аргумента в параметризованный конструктор
  • 0запустите / usr / bin / mysqld_safe в фоновом режиме
  • 0Ошибка Facebook и Codeigniter T_OBJECT_OPERATOR
  • 0fullcalendar вместе с вложениями в календарь Google
  • 0Я пытаюсь сделать регистрационную форму с MySQL в Java, и это дает мне ошибку
  • 1Преобразование байтового массива в изображение «Параметр недействителен».

First, give the solution directly:

Click a_ I, do not enter the size, directly click to execute

Analysis

When you use phpMyAdmin to create a database table, we usually need to set a primary key and let it grow by itself. But sometimes when you finish setting, you may find such an error:

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

The picture is shown as follows:

Fault analysis:

References

Preview SQL statement:

We found that there is indeed an additional 4 in primary key, so how to solve the problem
do you really need the command line to handle it?Of course not

Solution:

When setting self growth, we will see this interface:

Tips:
it is worth noting that this size is not a required value, but it is not very familiar with phpMyAdmin. It is easy to subconsciously set a value for the first time. Once it is set, the above error will appear
so the final solution is the size in the diagram. Here, we just need to leave the blank and click execute to save the table successfully

Similar Posts:

Понравилась статья? Поделить с друзьями:
  • Ошибка 10618 audi
  • Ошибка 1088 элвес мф
  • Ошибка 1062 sql
  • Ошибка 1088 субару
  • Ошибка 1062 mysql как исправить