LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2004, 03:05 AM   #1
TreeDragon60
LQ Newbie
 
Registered: Feb 2004
Location: Eastern PA
Distribution: Fedora Core
Posts: 16

Rep: Reputation: 0
How do I get a dump file (.sql) into MySql?


This has been making me crazy for the past 5 hours...and I can't find the answer anywhere.

I created a dump file "filename.sql" from an M$ Access Database that I want to get into MySql.

I thought the sytax was as follows:

mysql> \.testdb filename.sql
ERROR:
Failed to open file 'filename.sql', error: 2

I have tried the "source" command also, and tried every stinking syntax that I can think of - I'm sure it is probably something really stupid. BTW I added the ".sql" on the file for clarity - I've tried both with and without that.

Also, the .sql file opens up in my text editor just fine, and it looks like all the data is there and correct.

Thanks for any help on this - it's now 3AM on the east coast of US and I am fried from this thing!

mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
Fedora Core
.sql file created with ACCESSDump

That's all I can think of that might be relevant.
 
Old 03-20-2004, 03:13 AM   #2
vi0lat0r
Member
 
Registered: Aug 2003
Location: Lewisville, TX
Distribution: Kubuntu
Posts: 295

Rep: Reputation: 30
WINDOWS
You need MyODBC which you can download from http://www.mysql.com.

There are certainly more knowledgable people here who can explain it better,
but when I was trying to figure this out last week I found that the
documentation for MyODBC was not great, so here's how I did it, hopefully it
will work for you. Unfortunately you need to do some configuring first, but
once it is done it seems to run fine.

1) Unzip the MyODBC archive to any folder , I called mine MyODBC
2) Go to this folder and find the setup application and run it.
3) Choose MySQL from the list of ODBC drivers (This should be the only one
available).
4) Click on OK.
5) You will probably get another dialog called Data Source, you can cancel
this by clicking on close.
6) Go to Control Panel and find something that looks like "DataSource
(ODBC)". I am using Win2000 and I found this in Admin Tools. Once you have
found this run it.
7) Select System DSN from the tabs and click on ADD and scroll down the
available list of drivers until you find MySQL. Selec this and click on
Finsh.
8) Select a Data Source Name (DSN) such as "MySQL database" or whatever you
want.
9) Add the details of your MySQL server, such as host name, user name and
password. Be sure to include the port of 3306. (It took me ages to work this
out)
10) Click OK.

Thats it, you are ready to roll. Goto to MS Access and select export. From
the dialog of database types select ODBC (usually at the bottom). You will
then need to select the DSN you have set up, ie MySQL Database and you are
away, it should tranfer all of the data. You can also do the same in reverse
to import data from MySQL to Access.



LINUX
http://ems-hitech.com/mysqlutils/download.phtml

Last edited by vi0lat0r; 03-20-2004 at 03:14 AM.
 
Old 03-20-2004, 09:14 AM   #3
kobs
Member
 
Registered: Mar 2004
Location: 127.0.0.1
Distribution: FreeBSD 5.3-STABLE, Slackware 10-CURRENT, Debian Sarge
Posts: 51

Rep: Reputation: 15
I recommedn PHPMyadmin for maintaining MySQL databases. It is by far the best script. It allows you to export .sql files.

http://www.phpmyadmin.net/
 
Old 03-21-2004, 12:43 AM   #4
TreeDragon60
LQ Newbie
 
Registered: Feb 2004
Location: Eastern PA
Distribution: Fedora Core
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks ViO and kobs...

I downloaded the ODBC driver and got things set up (after a few issues of course...but that's what makes it fun) -

kobs - got the phpmyadmin...sweet! Really makes stuff nice and easy.

Thanks to you both for your help - greatly appreciated!
 
Old 03-21-2004, 06:19 AM   #5
kobs
Member
 
Registered: Mar 2004
Location: 127.0.0.1
Distribution: FreeBSD 5.3-STABLE, Slackware 10-CURRENT, Debian Sarge
Posts: 51

Rep: Reputation: 15
Yes I <33 phpmyadmin...It is a VERY great script...Simplifies all of your MySQL tasks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell scripting: Doing MySQL Dump base on date Swakoo Linux - General 2 09-21-2005 11:23 PM
MySQL :: Restoring Dump Swakoo Linux - General 6 09-09-2005 02:27 AM
Mysql with 10.2 dump barrythai Mandriva 2 04-11-2005 08:18 PM
Massive SQL dump without local access. xconspirisist Linux - General 1 01-30-2005 11:07 AM
How to forcely dump the history of user commands to the admin dump file. mcp_achindra Linux - Security 1 03-19-2004 01:04 PM


All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration