Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I work for a doctor's office, and we are in the process of switching EMR systems. The previous system has provided a physical 'dump' of the database. I however, don't know how to open this database and view the contents therein. The file is 1.2 gb with less then 1000 lines of SQL commands so I assume that all of the data is there. Here's what I've tried thus far:

  • Opened in a text reader: All it shows is a bunch of SQL commands to create the database tables
  • Installed MySQL Workbench and tried to create a "EER Model From SQL Script": This just creates the database structure.
  • Using MySQL Workbench/Setup a 'localhost' server: Tried a 'import' of the .sql file onto the newly created 'server' but it doesn't work and spits out an error

What are some steps to properly opening and obtaining the data found within a MySQL data dump?

I'm VERY new to the whole database management so if I've missed any details feel free to prompt.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Although there are a number of tools out there, I prefer the command line for tasks such as this. Better performance, and just simpler.

Make sure you're logged into the mysql client:

mysql -u <username> -p

The first step is to create a database in mysql that you want the data in:

CREATE DATABASE <database name>;

Then you need to open--or use--that new database, which is empty:

USE <database name>;

All that's left is to do the import:

\. /path/to/file (or if in Windows, \. C:\PATH\TO\FILE)

If all goes well, you'll see a bunch of output about "Query successful, N rows affected" and so on.

share|improve this answer
    
Worked perfectly! Thanks –  KronoS Jul 13 '11 at 17:04
    
No worries. Happy DBAing! –  Bryan Agee Jul 13 '11 at 17:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.