LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-24-2005, 07:36 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Ubuntu LTS
Posts: 418

Rep: Reputation: 34
mysqldump questions


Greetings Community. This isn't really a programming question, but I figured someone in here probably knows how to answer this.

I want to replicate the exact same database on a friends webserver onto my own server here at my house. So I figure what I need to do is create those sql scripts to rebuild everything. And to do that I use mysqldump right?

I've read the syntax's for mysqldump at mysql.com but I'm a lil confused because I connect to my database with multiple options:

Code:
mysql -u <myusername> -p -h <hostname> <dababasename>
is what I type in to connect to my database. And then it prompts me to enter in my lengthy password and then im in. So could anyone please tell me what I would type in to dump out every table from my database into a file that I could then use to source into my own server at home? Ps. I use SSH to establish this connection.

Thanks for reading and for the replies.
 
Old 10-24-2005, 08:07 PM   #2
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
mysqldump -A -a -u root -p >dump.sql

-A all data bases
-a all create options (indexes etc...)
you don't have to be root to run this just a user with enough permission to select on all tables on all db's.

to re-insert

mysql -u root -p <dump.sql

-Matt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
about mysqldump javier_ccs Programming 3 08-08-2005 06:13 PM
restore using mysqldump sporkit Linux - Networking 2 05-26-2004 05:34 PM
mysqldump - backup *.* bpk Linux - Newbie 1 03-29-2004 04:42 PM
MySQLDump and Cron duerra Linux - Newbie 6 02-20-2004 08:18 AM
compressing mysqldump output linen0ise Linux - Newbie 0 07-28-2003 07:27 PM


All times are GMT -5. The time now is 05:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration