This is a discussion on Import .sql file into MySQL within the MySQL forums, part of the Database Server Software category; --> I have a SQL Enterprise database that I need to import into a MySQL database. I generated a .sql ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a SQL Enterprise database that I need to import into a MySQL database. I generated a .sql file using the SQL Enterprise generate script tool, and when I try to import the file. I get the following error. ERROR 1064 (42000) at line 1: 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 'IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'lobster') DR' at line 1 " Any help is appreciated. Thanks! |
| |||
| "kristincollins77@gmail.com" <kristincollins77@gmail.com> wrote in news:1193320029.760640.275980@o80g2000hse.googlegr oups.com: > I have a SQL Enterprise database that I need to import into a MySQL > database. I generated a .sql file using the SQL Enterprise generate > script tool, and when I try to import the file. I get the following > error. > > ERROR 1064 (42000) at line 1: 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 'IF EXISTS (SELECT name FROM > master.dbo.sysdatabases WHERE name = N'lobster') > DR' at line 1 > " > > Any help is appreciated. > > Thanks! > > it looks like the queries in your file aren't all formatted/escaped properly, and that you have a syntax error near that line. open up the file and see what it is! early guess is that your apostrophes aren't escaped... ie: 'lobster' vs \'lobster\' |
| |||
| Good Man wrote: > "kristincollins77@gmail.com" <kristincollins77@gmail.com> wrote in > news:1193320029.760640.275980@o80g2000hse.googlegr oups.com: > >> I have a SQL Enterprise database that I need to import into a MySQL >> database. I generated a .sql file using the SQL Enterprise generate >> script tool, and when I try to import the file. I get the following >> error. >> >> ERROR 1064 (42000) at line 1: 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 'IF EXISTS (SELECT name FROM >> master.dbo.sysdatabases WHERE name = N'lobster') >> DR' at line 1 >> " >> >> Any help is appreciated. >> >> Thanks! >> >> > > it looks like the queries in your file aren't all formatted/escaped > properly, and that you have a syntax error near that line. open up the > file and see what it is! early guess is that your apostrophes aren't > escaped... ie: 'lobster' vs \'lobster\' > you might be better off if you export to a csv file and then import that to mysql. |
| ||||
| On Oct 25, 6:47 pm, "kristincollin...@gmail.com" <kristincollin...@gmail.com> wrote: > I have a SQL Enterprise database that I need to import into a MySQL > database. I generated a .sql file using the SQL Enterprise generate > script tool, and when I try to import the file. I get the following > error. > > ERROR 1064 (42000) at line 1: 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 'IF EXISTS (SELECT name FROM > master.dbo.sysdatabases WHERE name = N'lobster') > DR' at line 1 > " > > Any help is appreciated. > > Thanks! Hi, In MySQL we dont have the master system database, which is present in SQL Server. So its quite obvious that any reference to these databases in the script would cause the script to fail. I still doubt as to why the script are failing. Are you simply transfering data or are you also creating the tables from the script onn your target database. In case of scripts that do just DML, there shoudl not be any problems. Hope this helps. Regards Jackal |
| Thread Tools | |
| Display Modes | |
|
|