I have a .sql file and I want to load it into MySQL database. I don’t know from which database (MySQL or MS-SQL) it was created.
Now, I am trying to import that file into MySQL database. It is showing errors while importing and executing that file.
Q1. So, my question is whether the .sql file generated from MySQL and MS-SQL are different?
Note: I am using SQLYog software (graphical interface for MySQL) for importing the file.
Here is the ERROR:
Query:
CREATE TABLEads(
idbigint(20) NOT NULL auto_increment,
city_idint(11) NOT NULL,
typetext collate utf8_bin NOT NULL,
towntext collate utf8_bin NOT NULL,
addresstext collate utf8_bin NOT NULL,
pricetext collate utf8_bin NOT NULL,
infotext collate utf8_bin NOT NULL,
linktext collate utf8_bin NOT NULL,
hasImageint(11) NOT NULL,
languagevarchar(2) collate utf8_bin NOT NULL,
time_addedvarchar(255) collate utf8_bin NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1
Error occured at:2009-09-08 17:41:01
Line no.:35
Error Code: 1050 – Table ‘ads’ already exists
Query:
CREATE TABLEads(
idbigint(20) NOT NULL auto_increment,
city_idint(11) NOT NULL,
typetext collate utf8_bin NOT NULL,
towntext collate utf8_bin NOT NULL,
addresstext collate utf8_bin NOT NULL,
pricetext collate utf8_bin NOT NULL,
infotext collate utf8_bin NOT NULL,
linktext collate utf8_bin NOT NULL,
hasImageint(11) NOT NULL,
languagevarchar(2) collate utf8_bin NOT NULL,
time_addedvarchar(255) collate utf8_bin NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1
Error occured at:2009-09-08 17:41:21
Line no.:35
Error Code: 1050 – Table ‘ads’ already exists
Query:
CREATE TABLEads(
idbigint(20) NOT NULL auto_increment,
city_idint(11) NOT NULL,
typetext collate utf8_bin NOT NULL,
towntext collate utf8_bin NOT NULL,
addresstext collate utf8_bin NOT NULL,
pricetext collate utf8_bin NOT NULL,
infotext collate utf8_bin NOT NULL,
linktext collate utf8_bin NOT NULL,
hasImageint(11) NOT NULL,
languagevarchar(2) collate utf8_bin NOT NULL,
time_addedvarchar(255) collate utf8_bin NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1
Error occured at:2009-09-08 17:41:35
Line no.:35
Error Code: 1050 – Table ‘ads’ already exists
Query:
CREATE TABLEads(
idbigint(20) NOT NULL auto_increment,
city_idint(11) NOT NULL,
typetext collate utf8_bin NOT NULL,
towntext collate utf8_bin NOT NULL,
addresstext collate utf8_bin NOT NULL,
pricetext collate utf8_bin NOT NULL,
infotext collate utf8_bin NOT NULL,
linktext collate utf8_bin NOT NULL,
hasImageint(11) NOT NULL,
languagevarchar(2) collate utf8_bin NOT NULL,
time_addedvarchar(255) collate utf8_bin NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1
Error occured at:2009-09-08 17:42:07
Line no.:35
Error Code: 1050 – Table ‘ads’ already exists
Query:
1 Stanford University 6700 http://www.orkut.co.in
.
.
.
The file extension “.sql” is essentially meaningless: it’s just there so that you know what the file is. It will just be a plain text file containing SQL, which you can open in Notepad. Therefore, there’s no special “mysql” or “sql server” extensions.
The errors you’re getting there
"Table 'ads' already exists"are because you’re trying to create a table which already exists in the database. (Did you read the error?) You have a few options:Change the SQL to this:
Change the SQL to this:
Clear out all the tables in the DB first.