Unix Technical Forum

Import .sql file into MySQL

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:29 AM
kristincollins77@gmail.com
 
Posts: n/a
Default Import .sql file into MySQL

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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:29 AM
Good Man
 
Posts: n/a
Default Re: Import .sql file into MySQL

"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\'

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:29 AM
lark
 
Posts: n/a
Default Re: Import .sql file into MySQL

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:29 AM
jackal_on_work@yahoo.com
 
Posts: n/a
Default Re: Import .sql file into 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:47 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com