#1  
Old 3rd May 2005, 12:40
woody woody is offline
Junior Member
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL dumps

I know I can do this by using phpMyAdmin, but I wonder if/how I can create sql dumps of my MySQL databases on the commandline?
Reply With Quote
Sponsored Links
  #2  
Old 3rd May 2005, 16:41
sphere sphere is offline
Junior Member
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Instructions for dumping a MySQL database can be found here...

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

on the MySQL website.

Cheers.
Reply With Quote
  #3  
Old 4th May 2005, 11:57
ingo ingo is offline
Junior Member
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

If you don't have a database password (very insecure!), use this:

Code:
mysqldump -h <db_server, e.g. localhost> -u <db_user, e.g. root> -c --add-drop-table --add-locks --all --quick --lock-tables <db_name> > /path/to/your/sql_dump.sql
If you have a database password:

Code:
mysqldump -h <db_server, e.g. localhost> -u <db_user, e.g. root> -p<db_password, no space after -p!> -c --add-drop-table --add-locks --all --quick --lock-tables <db_name> > /path/to/your/sql_dump.sql
Ingo
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:06.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.