LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2005, 11:33 PM   #1
canuck_barlow
Member
 
Registered: Dec 2004
Distribution: Fedora Core 5
Posts: 64

Rep: Reputation: 15
MySQL Help


How do I copy a MySQL DB on one computer to another?

(This is probably a really easy question but I'm having some difficulty)
 
Old 03-14-2005, 11:38 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Easiest way is to use mysqldump...
 
Old 03-15-2005, 12:24 AM   #3
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
MySQL online documentation

Backup your existing database
read
Code:
mysqldump --opt db_name > backup-file.sql
or if you want to compress it to an archive go with this command:
Code:
mysqldump --opt -u user --password="password"
database | bzip2 -c > database.sql.bz2
Copy MySQL database to another computer
read
Code:
mysqladmin create db_name
cat DUMPDIR/*.sql | mysql db_name
Good luck!
Boby
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration