Phpmyadmin ошибка 1075

Hi,
I’m importing mySql database (which was originally an access database) into phpmyadmin and its giving me this error:

SQL query:

CREATE TABLE  `Acc_inst` (

 `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
 `inst_Name` VARCHAR( 255 ) ,
 `Inst_Ws` VARCHAR( 255 ) ,
 `inst_ph` VARCHAR( 255 ) ,
 `inst_Fx` VARCHAR( 255 ) ,
 `Inst_E` VARCHAR( 255 )
) ENGINE = INNODB DEFAULT CHARSET = utf8;

MySQL said: Documentation

1075 — Incorrect table definition; there can be only one auto column and it must be defined as a key


There is in fact only on auto increment column and it is defined as a primary key so I dont get why its giving me this error

Brett Schneider's user avatar

asked Dec 1, 2013 at 9:17

Nimara's user avatar

A bit late, but i’m getting the same error in the latest version of phpMyAdmin (4.4.2). Nimara used manual SQL query, i used the special «add new table» form and still got this error.

So, for those of you that got here just like me, searching the #1075 error, you should know that this happens if you set your index / primary / autoincrement column in the form at first, then added some new columns and then wanted to submit the form. It seems that when you add more columns, phpMyAdmin does some kind of background refresh and loses the «primary» information. You still see it in your form, but in the background the SQL query it sends does not have this info any more.

So the solution would be to deselect your primary column and set it again.
I’m pretty sure it’s a bug, but it solves simple and fast this way.

answered Apr 16, 2015 at 21:12

AdrianC's user avatar

AdrianCAdrianC

1411 silver badge2 bronze badges

Define your auto increment column as a primary key.

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 ) ,
   PRIMARY KEY `inst_ID`(`inst_ID`)
) ENGINE = INNODB DEFAULT CHARSET = utf8;

answered Dec 1, 2013 at 9:22

Tarun's user avatar

TarunTarun

3,1353 gold badges27 silver badges45 bronze badges

0

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL primary key AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 )
) ENGINE = INNODB DEFAULT CHARSET = utf8;

The error says you must define an auto increment column as key: Add primary key to this column definition.

answered Dec 1, 2013 at 9:18

juergen d's user avatar

juergen djuergen d

201k36 gold badges290 silver badges357 bronze badges

I’m importing a MySql database into phpmyadmin and it’s giving me this error:

1075 — Incorrect table definition; there can be only one auto column and it must be defined as a key

SQL Query:

CREATE TABLE `global_config` (
  `id` int(10) primary key NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `sitename` varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
  `siteurl` varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
  `admin_email` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `mail_from` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `smtp_from` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `smtp_pass` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `app_enabled` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `paypal_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `paypal_sandbox` varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
  `meta_description` varchar(1024) COLLATE utf8_unicode_ci NOT NULL,
  `meta_keywords` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `fb_profile_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `fb_page_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `twitter_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `instagram_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pinterest_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `youtube_upload` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `global_message` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `referer_prize` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `fb_verified_likes` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tw_verified_followers` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `in_verified_followers` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pin_verified_followers` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `yt_verified_subscribers` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `yt_verified_views` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `min_payout_amount` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `per_ads_payout` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `credit_system` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `enable_cash_payout` int(10) unsigned NOT NULL AUTO_INCREMENT
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Solution 1

Define your auto increment column as a primary key.

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 ) ,
   PRIMARY KEY `inst_ID`(`inst_ID`)
) ENGINE = INNODB DEFAULT CHARSET = utf8;

Solution 2

A bit late, but i’m getting the same error in the latest version of phpMyAdmin (4.4.2). Nimara used manual SQL query, i used the special «add new table» form and still got this error.

So, for those of you that got here just like me, searching the #1075 error, you should know that this happens if you set your index / primary / autoincrement column in the form at first, then added some new columns and then wanted to submit the form. It seems that when you add more columns, phpMyAdmin does some kind of background refresh and loses the «primary» information. You still see it in your form, but in the background the SQL query it sends does not have this info any more.

So the solution would be to deselect your primary column and set it again.
I’m pretty sure it’s a bug, but it solves simple and fast this way.

Solution 3

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL primary key AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 )
) ENGINE = INNODB DEFAULT CHARSET = utf8;

The error says you must define an auto increment column as key: Add primary key to this column definition.

Comments

  • Hi,
    I’m importing mySql database (which was originally an access database) into phpmyadmin and its giving me this error:

    SQL query:

    CREATE TABLE  `Acc_inst` (
    
     `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
     `inst_Name` VARCHAR( 255 ) ,
     `Inst_Ws` VARCHAR( 255 ) ,
     `inst_ph` VARCHAR( 255 ) ,
     `inst_Fx` VARCHAR( 255 ) ,
     `Inst_E` VARCHAR( 255 )
    ) ENGINE = INNODB DEFAULT CHARSET = utf8;
    

    MySQL said: Documentation

    1075 — Incorrect table definition; there can be only one auto column and it must be defined as a key


    There is in fact only on auto increment column and it is defined as a primary key so I dont get why its giving me this error

Recents

Related

Вы не вошли. Пожалуйста, войдите или зарегистрируйтесь.

Активные темы Темы без ответов

Ошибка MySQL при переносе таблицы: #1075 — Incorrect table definition

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

1 2006-09-30 20:21:15

  • duremar
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2006-09-29
  • Сообщений: 5

Тема: Ошибка MySQL при переносе таблицы: #1075 — Incorrect table definition

Переношу сайт себе на локальный компьютер, программил не я. При переносе одной из таблиц появляется ошибка — #1075 — Incorrect table definition; There can only be one auto column and it must be defined as a key

Нифига не понимаю в базах, но перести очень надо. Объясните, что не так. Насколько понял причина в этом:

CREATE TABLE `md_content` (
`ID` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`Parent` INT( 11 ) NOT NULL DEFAULT ‘0’,
`Level` INT( 11 ) NOT NULL DEFAULT ‘0’,
`Name` VARCHAR( 50 ) NOT NULL ,
……………..
…………….
……………
`Work` CHAR( 3 ) NOT NULL DEFAULT ‘000’,
……………
……………
…………..

Вроде как проблема именно в строке Work. Что именно не нравится?

2 Ответ от Lokki 2006-10-01 05:37:14

  • Lokki
  • Lokki
  • Админ
  • Неактивен
  • Откуда: Москва
  • Зарегистрирован: 2006-01-25
  • Сообщений: 910

Re: Ошибка MySQL при переносе таблицы: #1075 — Incorrect table definition

duremar
Правила читаем, в особенности путкт 5 (Называние топику следует давать такое, чтобы оно соответствовало теме  и отражало её суть) и больше их не нарушаем.

При переносе одной из таблиц появляется ошибка — #1075 — Incorrect table definition; There can only be one auto column and it must be defined as a key

MySQL-сервер сигналит тебе, что в таблице может быть только одно поле с атрибутом AUTO_INCREMENT, которое должно быть индексом. Например так:

CREATE TABLE `md_content` (
`ID` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`Parent` INT( 11 ) NOT NULL DEFAULT '0',
`Level` INT( 11 ) NOT NULL DEFAULT '0',
`Name` VARCHAR( 50 ) NOT NULL ,
.................
................
...............
`Work` CHAR( 3 ) NOT NULL DEFAULT '000',
PRIMARY KEY  (`ID`)
);

Обрати внимание на следующие строки, которые в твоем случае являются ключевыми:
`ID` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
PRIMARY KEY  (`ID`)

Нет неразрешимых проблем, есть неприятные решения. (Э. Борн)

Сообщения 2

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

Tags:

sql

php

mysql

phpmyadmin

Hi,
I’m importing mySql database (which was originally an access database) into phpmyadmin and its giving me this error:

SQL query:

CREATE TABLE  `Acc_inst` (

 `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
 `inst_Name` VARCHAR( 255 ) ,
 `Inst_Ws` VARCHAR( 255 ) ,
 `inst_ph` VARCHAR( 255 ) ,
 `inst_Fx` VARCHAR( 255 ) ,
 `Inst_E` VARCHAR( 255 )
) ENGINE = INNODB DEFAULT CHARSET = utf8;

MySQL said: Documentation

1075 — Incorrect table definition; there can be only one auto column and it must be defined as a key


There is in fact only on auto increment column and it is defined as a primary key so I dont get why its giving me this error

like image
312


People also ask

What phpMyAdmin used for?

phpMyAdmin is a free software tool written in PHP that is intended to handle the administration of a MySQL or MariaDB database server. You can use phpMyAdmin to perform most administration tasks, including creating a database, running queries, and adding user accounts.

Is phpMyAdmin and MySQL same?

MySQL is a RDBMS (Relational DataBase Management System), PhpMyAdmin is a web application wich let you manage (with a visual interface) MySQL Databases.

Is phpMyAdmin still used?

We have data on 5,073 companies that use phpMyAdmin. The companies using phpMyAdmin are most often found in United States and in the Information Technology and Services industry. phpMyAdmin is most often used by companies with 10-50 employees and 1M-10M dollars in revenue.

How do I access phpMyAdmin localhost?

Once phpMyAdmin is installed point your browser to http://localhost/phpmyadmin to start using it. You should be able to login using any users you’ve setup in MySQL. If no users have been setup, use admin with no password to login.

What is phpMyAdmin and how to use it?

phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing

How do I login to localhost phpMyAdmin?

open http://localhost/phpmyadmin/ . http://localhost/phpmyadmin is a part of localhost database administration software (phpmyadmin) url login address. You can enter the address from http://localhost/phpmyadmin or you can use the following terminal input tool (web-based viewer).

What is the IP address for access phpMyAdmin?

Access phpMyAdminon port 8889:http://localhost:8889/phpmyadmin Your IP Address 207.46.13.127 This IP address is not the IP address used by your computer to communicate with other machines on your network. Change IP Address? Access possible folders or projects

Which softwares are required to install before phpMyAdmin?

With the Apache Server: In this process, the Apache server, the PHP, and the MySQL database are the softwares that are required to be installed beforehand, that is, before installing the actual phpMyAdmin tool to the same system.


3 Answers

A bit late, but i’m getting the same error in the latest version of phpMyAdmin (4.4.2). Nimara used manual SQL query, i used the special «add new table» form and still got this error.

So, for those of you that got here just like me, searching the #1075 error, you should know that this happens if you set your index / primary / autoincrement column in the form at first, then added some new columns and then wanted to submit the form. It seems that when you add more columns, phpMyAdmin does some kind of background refresh and loses the «primary» information. You still see it in your form, but in the background the SQL query it sends does not have this info any more.

So the solution would be to deselect your primary column and set it again.
I’m pretty sure it’s a bug, but it solves simple and fast this way.

like image
175


Define your auto increment column as a primary key.

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 ) ,
   PRIMARY KEY `inst_ID`(`inst_ID`)
) ENGINE = INNODB DEFAULT CHARSET = utf8;

like image
37

Tarun Avatar

answered Oct 19 ’22 03:10

Tarun


CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL primary key AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 )
) ENGINE = INNODB DEFAULT CHARSET = utf8;

The error says you must define an auto increment column as key: Add primary key to this column definition.

like image
6



Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Phpmyadmin 2002 ошибка
  • Phpmailer ошибка сервера номер 500
  • Php отлавливание ошибок
  • Php отключить ошибки функции

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии