Zen Cart Logo
Forums / General Questions / How to use phpMyAdmin to get a copy of your raw dbase sql

How to use phpMyAdmin to get a copy of your raw dbase sql

Locked

Views: 2,845

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
11 Nov 2009, 7:33 PM
#1
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

How to use phpMyAdmin to get a copy of your raw dbase sql

I just posted this in another thread, but feel there could be interest in it in this General Section:

I am often asked how to get a "copy" of the database's raw SQL, to be used either as a backup, or as a means of "populating" a new empty database.

Here's my technique and while it works for me, the following is not a gospel, but a method I have found to be reliable and consistently effective.


Here's my procedure:

  1. Go to the database in phpMyAdmin, so that the screen displays all the tables (left pane) and all the tables (right pane). This is the default display when you select the database from the menu.

  2. Click EXPORT tab (Right Pane... top).

  3. Select ALL tables, click Radio Button SQL.

  4. Under OPTIONS:
    Add custom comment into header (\n splits lines) [EMPTY]
    Enclose export in a transaction [UNCHECKED]
    Disable foreign key checks [UNCHECKED]
    SQL compatibility mode [NONE]

Structure [CHECKED]
Add DROP TABLE / VIEW / PROCEDURE / FUNCTION [UNCHECKED]
Add IF NOT EXISTS [CHECKED]
Add AUTO_INCREMENT value [CHECKED]
Enclose table and field names with backquotes [CHECKED]
Add CREATE PROCEDURE / FUNCTION [UNCHECKED]

Add into comments (Creation/Update/Check dates) [UNCHECKED] But can be checked if you want.

Data [CHECKED]
Complete inserts [CHECKED]
Extended inserts [CHECKED]
Maximal length of created query [50000] You may need to change this, but this is default and should be OK.
Use delayed inserts [UNCHECKED]
Use ignore inserts [UNCHECKED]
Use hexadecimal for BLOB [CHECKED]
Export type [INSERT] (If my db crashes badly, I generally create a brand new one, so INSERT is appropriate for me.

This will DUMP a lot of "SQL TXT" into the frame. The bigger your db, the more the TXT.

I just then COPY <ctrl + c> and then PASTE <ctrl + v> into a blank notepad++ file, and save it as .sql with an appropriate name that includes the DATE and TIME I did the dump.


I use the above to CLONE databases all the time and over many years, havev never had a failure. On one occasion the version of MySQL was OLDER than my dump, so in SQL compatibility mode, I made necessary adjustments...

11 Nov 2009, 9:30 PM
#2
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: How to use phpMyAdmin to get a copy of your raw dbase sql

If you tick the "Save As File" box at the bottom of the Export page it will automatically download the SQL as [database name].sql

11 Nov 2009, 9:58 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to use phpMyAdmin to get a copy of your raw dbase sql

I don't know why we bother writing FAQ articles if people never read them ... https://www.zen-cart.com/tutorials/index.php?article=103

11 Nov 2009, 10:29 PM
#4
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: How to use phpMyAdmin to get a copy of your raw dbase sql

DrByte:

I don't know why we bother writing FAQ articles if people never read them ... https://www.zen-cart.com/tutorials/index.php?article=103

You are probably right- 90% of the questions asked in the forum are either already covered in the FAQ or in a previous thread.

12 Nov 2009, 1:52 AM
#5
johnny43 avatar

johnny43

Zen Follower

Join Date:
Feb 2006
Posts:
231
Plugin Contributions:
0

Re: How to use phpMyAdmin to get a copy of your raw dbase sql

DrByte:

I don't know why we bother writing FAQ articles if people never read them ... https://www.zen-cart.com/tutorials/index.php?article=103

I Myself fall into the trap of posting questions before SEARCHING the site for what I'm looking for.
Also I can understand the urge to get the answers ASAP...

That said I would sugest that if anyone comes across a post which can be resolved by FAQ, WIKI why not just refer to that FAQ, post or whatever...That way if we keep pointing to those GENERIC answers people just might catch on that the mystery of Zen Cart is a FAQ away....

Cheers,
Johnny

12 Nov 2009, 7:31 AM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How to use phpMyAdmin to get a copy of your raw dbase sql

DrByte:

I don't know why we bother writing FAQ articles if people never read them ... https://www.zen-cart.com/tutorials/index.php?article=103

Well, this is quite interesting...
I did do a search to see if this was available in the FAQ, but I didn't turn up this result.

... and I am normally quite good at finding the result. :D

If this post is thus superfluous, I'm more than happy for it to be removed.