Register  |  Login

Question Details    

   Question

Time: 00:14 - Feb 10, 2007     Asked by: sophiak      Status: Answered      Points: 75   

Opening file with .sql extension

I've backed up my wordpress mysql database to a file with extension .sql . I'd like to access the data in that file, perhaps to repurpose the postings. I'm hoping there's some way to open it., preferably in MS Access.

I've tried opening it directly in Access 2002, but it doesn't support the format, nor is it one of the file options to link to. I know I can link to other databases from Access using ODBC. I've set up odbc connections before, but I haven't the foggiest how to set up an odbc connection to this file. I have some inkling I'm supposed to install mysql in order to read the file and then access it, but the msql site didn't yield much in the way of guidance for me.

If someone could point me in the right direction, that'd be great.

Ask a New Question

Become a Quomon Expert

Current Categories

 

Other Questions Needing Answers


   

Answer Discussion
Answer Discussion
Answer Summaries
Answer Summary
 
Normally an .sql file is just a text file with a lot of sql statements to be executed.
So if you run it with notepad you can see the text.
If you need to run the sql statements in Access, there probably is some kind of sql editor in access where you can copy paste the statements and execute them.
Beware though that it might not be possible to execute mysql statements on the access database without problems, since there could be some differences in the syntax. If you have problems, you can post the statements here and I can see if I can help you.
good luck

Expert:

theDude

Date:

Feb 10, 2007

Time:

01:09

 

Votes: Good (0) | Bad (0)
Login to rate this answer

It's actually meant to be a data file, backing up several tables in a mysql database. It's generated by a backup plugin integrated into wordpress. On opening it in notepad, I get lots of non-alpha characters, so I don't think it's sql query statements. What I'm trying to get at is the data.

Expert:

sophiak

Date:

Feb 10, 2007

Time:

01:19

 

Votes: Good (0) | Bad (0)
Login to rate this answer

I did find a site with some user-friendly install instructions for mysql for windows, so I'm exploring that as an option to open the file and get at the data. Seems fairly straightforward: http://www.analysisandsolutions.com/code...

Expert:

sophiak

Date:

Feb 10, 2007

Time:

01:21

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Okay, now I've installed mysql and it's not particularly evident how I could use it to open or access the data in this file. The help files in mysql seem to be about anything but. Am I barking up the wrong tree here? Any thoughts?

Expert:

sophiak

Date:

Feb 10, 2007

Time:

01:32

 

Votes: Good (0) | Bad (0)
Login to rate this answer

did you try opening it with wordpad or word? it might just be the text-format that's making trouble...

Expert:

theDude

Date:

Feb 10, 2007

Time:

01:33

 

Votes: Good (0) | Bad (0)
Login to rate this answer

did you install phpmyadmin to administrate the mysql database?
in there is a "Import" function that allows you to upload an .sql file.

Expert:

theDude

Date:

Feb 10, 2007

Time:

01:36

 

Votes: Good (0) | Bad (0)
Login to rate this answer

I agree with theDude that a .sql file should be a text file that contains all the data incorporated in sql syntax INSERT statements, so that mysql - for instance through phpmyadmin - can import it easily.

If you cannot see the data with a text viewer, then it's either using a different character encoding, it's corrupt or maybe it's zip-compressed.

phpmyadmin does have import and export functions that compresses the sql files with zip, so wordpress might have done the same. I recommend to install phpmyadmin and try to import it.

jakob

Expert:

jgivoni

Date:

Feb 10, 2007

Time:

04:25

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Okay I'll try intsalling phpmyadmin and go from there. The file was zipped, but it's been unzipped now.

Expert:

sophia

Date:

Feb 10, 2007

Time:

13:29

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Sorry, I am not completely clear on what you try to achive and what you actually did. Please correct me if I am wrong. You did a backup of a MySql database (or table) using wordpress. This resulted in a .sql file. This .sql file can't be opened in i.e. Notepad.

What I guess is, that wordpress is using a .sql suffix for the backup file but it actually isn't a text based .sql file. If you do a backup using MySql administrator, you will get a text based sql file which you can open in Notepad. I assume that this wordpress sql file is a wordpress specific format and can only be used in wordpress. Sorry. I do not have any experience in wordpress. But I have some experience in MySQL.

I recommend to use MySql administrator (download here: http://www.mysql.org/downloads/gui-tools...), create a backup of the table. This will result in a text based sql file. Then you can create a blank database in MS Access, open a query, set the view to SQL and cut and paste the sql text from the backup file into this query. You can try and run it but be prepared that there are some differences between the SQL syntax of MySql and MS Access.

Let us know how you get on!

Cheers

Peter

Expert:

PeterNZ

Date:

Feb 19, 2007

Time:

17:44

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Question Answered

This question has been answered, and points have been rewarded to the following experts:

theDude: 5
jgivoni: 20
PeterNZ: 50

You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.

 
No summaries have been submitted yet. Want to be the first?



Respond to this question:

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

 

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password
   

"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it


All Questions


Language Options

English:

www.quomon.com

Español:

www.quomon.es

Sponsors

Questions and Answers Software
Real Estate Postcards
Marketing Fulfillment