LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-15-2012, 02:30 AM   #1
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Rep: Reputation: 0
Mysql table backup


Hi all,

can any one help me how to take mysql table backup from a database

Thank,
 
Old 02-15-2012, 02:34 AM   #2
jimtony
Member
 
Registered: Jan 2011
Location: Shanghai,China
Distribution: fedora
Posts: 73
Blog Entries: 1

Rep: Reputation: 2
See the following documents for your questions.

http://dev.mysql.com/doc/mysql-backu.../en/index.html
 
Old 02-15-2012, 02:39 AM   #3
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
The below command is correct to take a mysql table backup and restore

mysqldump dbname tablename > backup.sql
mysql dbname < backup.sql

Thanks,
 
Old 02-15-2012, 03:26 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by ramecare View Post
The below command is correct to take a mysql table backup and restore

mysqldump dbname tablename > backup.sql
mysql dbname < backup.sql

Thanks,

correct, but probably you will have to set username/password, like:
Code:
mysqldump -u username -ppassword   dbname > dbname_backup.sql

mysql -u username -ppassword  dbname < dbname_backup.sql
! See the -ppassword has no space between -p and password, that's how it works.

good luck
 
Old 02-15-2012, 03:38 AM   #5
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
The above command which u mentioned is to take mysql database backup and restore but i want the command to take backup and restore mysql database table


Thanks,

Last edited by ramecare; 02-15-2012 at 05:48 AM.
 
Old 02-15-2012, 08:52 AM   #6
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
I'm sorry, I overlooked that,
I just wanted to point that you probably will need to specify user / password to access that database.
 
Old 02-15-2012, 10:36 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ramecare View Post
The above command which u mentioned is to take mysql database backup and restore but i want the command to take backup and restore mysql database table

Thanks,
As you've been asked numerous time sin the past, SPELL OUT YOUR WORDS

And did you bother to read the man page on mysqldump, or try to look this up?? From the VERY TOP OF THE MAN PAGE:
Code:
SYNOPSIS
       mysqldump [options] [db_name [tbl_name ...]]
See the part where it tells you to put in the table name?? Try it.

Also, from a brief Google search...
http://www.thegeekstuff.com/2008/09/...ing-mysqldump/
See point 4 for a written example.
 
Old 02-15-2012, 11:27 AM   #8
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
Thank u very much
 
Old 02-15-2012, 11:47 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ramecare View Post
Thank u very much
Seriously?? Again, SPELL OUT YOUR WORDS
 
  


Reply



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
mysql 'Table 'mysql.user' doesn't exist' Joe of Loath Linux - Server 13 08-05-2010 06:54 AM
How to backup mysql single table with increment sgm277 Linux - Server 9 06-05-2008 01:16 AM
MYSQL DROP TABLE not working after restoring from backup. leongoogs Linux - Software 0 06-17-2004 07:16 PM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 12:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:20 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