By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

Export whole MySql database

P: n/a
Hi folks,

I am looking for the straightest way to export a whole MySql database, but
all I can find is SQL statements to export specific tables.
Any suggestions?

--
Freundliche Gre,
Franz Marksteiner

Feb 23 '08 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Franz Marksteiner wrote:
Hi folks,

I am looking for the straightest way to export a whole MySql database,
but all I can find is SQL statements to export specific tables.
Any suggestions?
Try a mysql newsgroup - such as comp.databases.mysql. Your question has
nothing to do with PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 23 '08 #2

P: n/a
On Feb 23, 1:28 pm, "Franz Marksteiner" <franzmarkstei...@gmail.com>
wrote:
Hi folks,

I am looking for the straightest way to export a whole MySql database, but
all I can find is SQL statements to export specific tables.
Any suggestions?

--
Freundliche Gre,
Franz Marksteiner
I think PHPMyAdmin will do it. That is, if you have access to that
handy little program.
Feb 23 '08 #3

P: n/a
Jerry Stuckle wrote:
Franz Marksteiner wrote:
>Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables. Any suggestions?

Try a mysql newsgroup - such as comp.databases.mysql. Your question
has nothing to do with PHP.
Just because the string "PHP" does not show up in my post, does not mean
that the post has nothing to do with it...

So if you ain`t got a clue simply don`t answer...

--
Freundliche Gre,
Franz Marksteiner

Feb 23 '08 #4

P: n/a
Franz Marksteiner wrote:
Jerry Stuckle wrote:
>Franz Marksteiner wrote:
>>Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables. Any suggestions?

Try a mysql newsgroup - such as comp.databases.mysql. Your question
has nothing to do with PHP.

Just because the string "PHP" does not show up in my post, does not mean
that the post has nothing to do with it...

So if you ain`t got a clue simply don`t answer...
Oh, I've got a clue. But you sure don't.

This isn't a MySQL newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 23 '08 #5

P: n/a
Franz Marksteiner wrote:
Jerry Stuckle wrote:
>Franz Marksteiner wrote:
>>Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables. Any suggestions?

Try a mysql newsgroup - such as comp.databases.mysql. Your question
has nothing to do with PHP.

Just because the string "PHP" does not show up in my post, does not mean
that the post has nothing to do with it...

So if you ain`t got a clue simply don`t answer...
And BTW - if you have a PHP question, what is that PHP question? All
you've asked about is MySQL - and this is not a MySQL newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 23 '08 #6

P: n/a
Franz Marksteiner schreef:
Jerry Stuckle wrote:
>Franz Marksteiner wrote:
>>Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables. Any suggestions?

Try a mysql newsgroup - such as comp.databases.mysql. Your question
has nothing to do with PHP.

Just because the string "PHP" does not show up in my post, does not mean
that the post has nothing to do with it...

So if you ain`t got a clue simply don`t answer...
system("mysqldump <...parameters...>");
for correct '<...parameters...>' please ask in some MySQL newsgroup ;-)

--
Luuk
Feb 23 '08 #7

P: n/a
..oO(Franz Marksteiner)
>Just because the string "PHP" does not show up in my post, does not mean
that the post has nothing to do with it...
What does dumping a DB to a file have to do with PHP?

Micha
Feb 23 '08 #8

P: n/a
Franz Marksteiner wrote:
Hi folks,

I am looking for the straightest way to export a whole MySql database,
but all I can find is SQL statements to export specific tables.
Any suggestions?
If its on linux, simply go into /var/lib/mysql/databasename and tar the
lot up..if you want a duplicate setup.

I believe that UNLOAD or DUMP will give you a format that you can use to
extract data from..
Feb 24 '08 #9

P: n/a
The Natural Philosopher wrote:
Franz Marksteiner wrote:
>Hi folks,

I am looking for the straightest way to export a whole MySql database,
but all I can find is SQL statements to export specific tables.
Any suggestions?
If its on linux, simply go into /var/lib/mysql/databasename and tar the
lot up..if you want a duplicate setup.
This is not at all safe!

I believe that UNLOAD or DUMP will give you a format that you can use to
extract data from..

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 24 '08 #10

P: n/a
Jerry Stuckle wrote:
The Natural Philosopher wrote:
>Franz Marksteiner wrote:
>>Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables.
Any suggestions?
If its on linux, simply go into /var/lib/mysql/databasename and tar
the lot up..if you want a duplicate setup.

This is not at all safe!
It is if you stop the mysqld daemon first.

At that point the daemon cleans all up, and flushes all its caches.

You will have a consistent database.
>
>I believe that UNLOAD or DUMP will give you a format that you can use
to extract data from..

Feb 24 '08 #11

P: n/a
..oO(The Natural Philosopher)
>Jerry Stuckle wrote:
>The Natural Philosopher wrote:
>>If its on linux, simply go into /var/lib/mysql/databasename and tar
the lot up..if you want a duplicate setup.

This is not at all safe!

It is if you stop the mysqld daemon first.
No. It's like copying raw inodes instead of using the appropriate higher
level tools for copying files.
>At that point the daemon cleans all up, and flushes all its caches.

You will have a consistent database.
But maybe with broken or no data at all. Not everyone uses MyISAM
tables. And even with MyISAM there are some things that may screw up
your data in such an operation.

The correct way is mysqldump, that's what this tool is for.

Micha
Feb 24 '08 #12

P: n/a
The Natural Philosopher wrote:
If its on linux, simply go into /var/lib/mysql/databasename and tar
the lot up..if you want a duplicate setup.
This is not at all safe!

It is if you stop the mysqld daemon first.

At that point the daemon cleans all up, and flushes all its caches.

You will have a consistent database.
No, Jerry is right. The method you suggested only works with the MyISAM
storage engine.

With any other storage engine (InnoDB comes to mind, which is the most
commonly used today because it supports transactions) your method leads
to data loss. I learned that the hard way.

Bye!
Feb 24 '08 #13

P: n/a
The Natural Philosopher wrote:
Jerry Stuckle wrote:
>The Natural Philosopher wrote:
>>Franz Marksteiner wrote:
Hi folks,

I am looking for the straightest way to export a whole MySql
database, but all I can find is SQL statements to export specific
tables.
Any suggestions?

If its on linux, simply go into /var/lib/mysql/databasename and tar
the lot up..if you want a duplicate setup.

This is not at all safe!

It is if you stop the mysqld daemon first.
Not necessarily.
At that point the daemon cleans all up, and flushes all its caches.
Not always.
You will have a consistent database.
Nope.
>>
>>I believe that UNLOAD or DUMP will give you a format that you can use
to extract data from..

Which is *EXACTLY* why people should ask questions in an appropriate
newsgroup. You will get good answers in comp.database.mysql. The MySQL
experts hang out there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 24 '08 #14

P: n/a
Anonymous wrote:
The Natural Philosopher wrote:
>>>If its on linux, simply go into /var/lib/mysql/databasename and tar
the lot up..if you want a duplicate setup.

This is not at all safe!
It is if you stop the mysqld daemon first.

At that point the daemon cleans all up, and flushes all its caches.

You will have a consistent database.

No, Jerry is right. The method you suggested only works with the MyISAM
storage engine.
Ok, I concede that point all right.
>
With any other storage engine (InnoDB comes to mind, which is the most
commonly used today because it supports transactions) your method leads
to data loss. I learned that the hard way.

Bye!
Feb 24 '08 #15

P: n/a
On Sat, 23 Feb 2008 19:28:24 +0100, Franz Marksteiner wrote:
Hi folks,

I am looking for the straightest way to export a whole MySql database, but
all I can find is SQL statements to export specific tables.
Any suggestions?
Look at mysqldump.

http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

--
I told you this was going to happen.

Feb 25 '08 #16

This discussion thread is closed

Replies have been disabled for this discussion.