Help: Backup and Copy MySQL DB

They have: 20 posts

Joined: Nov 2005

Hello,

I tried to create a backup copy of my mysql database using myphpadmin (forget the real name). I went to the export panel, selected all tables, selected insert as the export type, selected drop if exists, update and basically all other options.

It compressed the sql file into a zip and everything worked fine.

I then created another database that I will use for a test db and and test site. I tried to insert the sql statement into this new database and got an error in the sql parser.

I figured it could be due to the database name being differnet, but when I tried to import the sql file into the original database I extracted it from, I got the same error.

Does anyone have a link to instructions on:
1. how to backup a mysql database (what options to select, etc) and

2. How to restore a database from a backup?

Busy's picture

He has: 6,151 posts

Joined: May 2001

The reason I have come across for this is the versions of mysql are different.

depending on the size of the databse you can edit the .sql file and removed the ` (back comma under the ~ which is before the 1) and possibliy the empty defaults.
Other options included backup seperate tables (each table seperatly), and/or choose full inserts which can sometimes do the trick.

someone else maybe (hopefully) have an easier answer for you

They have: 20 posts

Joined: Nov 2005

Hi Busy and thanks for the reply. I could understand the versions of sql being different, but the databases are on the same domain/host and even trying to import the sql extract to the db from which I took it, failed.

Busy's picture

He has: 6,151 posts

Joined: May 2001

I have had same problem, i remember if I downloaded a sql, csf or whatever it wouldn't upload but if I returned the results on screen and copy and pasted it worked. I think that time it was a size issue

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.