Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 00:14 - Feb 10, 2007  

sophiak

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.

Answer Discussion
Tutorials

 

theDude

Date:: Feb 10, 2007

Time:: 01:09

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

sophiak

Date:: Feb 10, 2007

Time:: 01:19

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.

sophiak

Date:: Feb 10, 2007

Time:: 01:21

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

sophiak

Date:: Feb 10, 2007

Time:: 01:32

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?

theDude

Date:: Feb 10, 2007

Time:: 01:33

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

theDude

Date:: Feb 10, 2007

Time:: 01:36

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

jgivoni

Date:: Feb 10, 2007

Time:: 04:25

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

sophia

Date:: Feb 10, 2007

Time:: 13:29

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

PeterNZ

Date:: Feb 19, 2007

Time:: 17:44

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

Question Answered

This question has been closed, 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 a Tutorial in the Tutorial Area.

Answer 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:

Forgot Your Password?

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

Answer 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:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




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



Language Options

English:

www.quomon.com

Español:

www.quomon.es