Database test1, table Users, fields xxx and Name.
Using XAMPP Control Panel v3.2.2: I start Apache and MySQL, then I click on Admin on the MySQL line and get the phpMyAdmin page.
Click on Databases, enter test1 in the Create database field, leave the dropdown as “Collation” and click on Create.
The database is created and I enter “Users” in the Create table name field and change the number of columns to 2, then I click “Go”.
I enter “xxx” in the first name field, leave type as INT, set Length to 10, leave default as None and click the A…I box.
When I do that a form pops up labeled Add index, and I cancel out of it. I have tried all different ways of handling that pop up menu, nothing works!
I fill in the second field as Name, Varchar 50.
The preview SQL gives me:
- Code: Select all
CREATE TABLE `test1`.`Users` ( `xxx` INT(10) NOT NULL AUTO_INCREMENT , `Name` VARCHAR(50) NOT NULL ) ENGINE = InnoDB;
Then I hit the save button and get the pop up message:
- Code: Select all
#1075: Incorrent table definition, there can be only one auto column and it must be defined as a key.
The dropdown for Type for each column does not include “key”. How do I create a table with an auto increment key?