Mysql error with syntax to create table

Mysql error with syntax to create table

emmanuelemmanuel Posts: 6Questions: 4Answers: 0

i got this error while uploading the mysql file produced by generator.

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identity, Forexname varchar(255), Address varchar(255), Buying varchar(255), ' at line 7

the syntax that was run must have been:
CREATE TABLE current(
id int NOT NULL identity,
Forexname varchar( 255 ) ,
Address varchar( 255 ) ,

how do i get passed this plz. thanks in advance

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    That looks like SQL for SQLServer.

    It should be producing SQL that looks like this:

    CREATE TABLE test (
        id int(10) NOT NULL auto_increment,
        name varchar(255),
        address varchar(255),
        PRIMARY KEY( `id` )
    );
    

    Note the auto_increment rather than the identity.

    Could you try running Generator again when the "MySQL" option selected?

    Thanks,
    Allan

  • emmanuelemmanuel Posts: 6Questions: 4Answers: 0

    ah....i figured i had selected sql database instead of mysql/maria...
    didnt realize they were different. I got it to complete the table creation. thx

This discussion has been closed.