Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-20-2004, 02:05 AM   #1
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
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, 02:13 AM   #2
Registered: Aug 2003
Location: Lewisville, TX
Distribution: Kubuntu
Posts: 295

Rep: Reputation: 30
You need MyODBC which you can download from

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
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
8) Select a Data Source Name (DSN) such as "MySQL database" or whatever you
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
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.


Last edited by vi0lat0r; 03-20-2004 at 02:14 AM.
Old 03-20-2004, 08:14 AM   #3
Registered: Mar 2004
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.
Old 03-20-2004, 11:43 PM   #4
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, 05:19 AM   #5
Registered: Mar 2004
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


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 10:23 PM
MySQL :: Restoring Dump Swakoo Linux - General 6 09-09-2005 01:27 AM
Mysql with 10.2 dump barrythai Mandriva 2 04-11-2005 07:18 PM
Massive SQL dump without local access. xconspirisist Linux - General 1 01-30-2005 10:07 AM
How to forcely dump the history of user commands to the admin dump file. mcp_achindra Linux - Security 1 03-19-2004 12:04 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:08 AM.

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