LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-16-2012, 03:17 AM   #1
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Rep: Reputation: 0
Smile Mysql Physical Backup


Good day to all,

Heare iam taking mysqldump backup in my server and i can any one help me how to take mysql physical backup and is copying /var/lib/mysql a good alterntive to mysqldump?


Thanks,
 
Old 05-16-2012, 03:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by ramecare View Post
Heare iam taking mysqldump backup in my server and i can any one help me how to take mysql physical backup
Copy the resulting mysqldump files to another filesystem / another server / rsync to a cloud / copy to usb / ftp them home.

Quote:
Originally Posted by ramecare View Post
and is copying /var/lib/mysql a good alterntive to mysqldump?
Only if you shutdown the MySQL server daemon while you do the copy, and even then my preference would be to use mysqldump.

There are at least two other recent threads on mysql backup:
http://www.linuxquestions.org/questi...command-934730
http://www.linuxquestions.org/questi...sqldump-914773
 
Old 05-16-2012, 04:16 AM   #3
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
Hi,

I have stopped mysql service and i have taken backup /var/lib/mysql using tar and in another server i have installed mysql and i replcaed the backup to /var/lib/mysql and i started mysql service and i was not able to access the database,can u please assist me


Thanks,
 
Old 05-17-2012, 01:12 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Like he said, stick to mysqldump unless you are an advanced mysql dba
 
Old 05-17-2012, 02:51 AM   #5
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
Hi !

I know how to take mysqldump backup and i like to learn how to take physical backup in mysql as i mention above.can any one assist me.

Thanks,
 
Old 05-17-2012, 03:07 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
mysqldump or realtime replication and mysqldump are the best and most reliable methods of backup up databases, especially if they have multiple or mixed table engines such as innodb/myisam/memory. These are the prefered methods of backup up MySQL databases.

IF you have a database where you KNOW that the only storage engine is MyISAM then with shutting down the whole MySQL server process and copying the relevant folder then you can take the kind of backup you need.

If you simply shut down and copy the whole /var/lib/mysql "tree" and then drop it on to a different server then it may or may not work (as you've already discovered).

The databases I'm backup up with mysqldump consist of millions of rows and are used to transact millions of dollars of business each month, so I'm not playing with a database of some 100 post WordPress sites. I use this method because it works simply, is reliable, and gives consistent results without having to stop the database server. It's also highly suited to scripting backups for different databases (See the script examples in the other threads for details).

If you wish to go down the stop server/copy files route then good luck with that.
 
Old 05-18-2012, 01:47 AM   #7
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Original Poster
Rep: Reputation: 0
Hi TenTenths !

I agree with u and i will go with mysqldump backup Thank you one again

Last edited by ramecare; 05-18-2012 at 04:48 AM.
 
  


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
[SOLVED] How to migrate linux mysql dump backup to windows mysql server sunrised24 Linux - Server 2 02-14-2012 01:58 PM
Recover MySQL Innodb from /var/lib/mysql/ backup? eteck Linux - Server 1 01-31-2011 01:36 AM
how to create backup MYSQL Script to backup my database for every 1hour RMLinux Linux - Newbie 3 11-20-2008 10:13 AM
How hard to get MySQL data served from a separate physical drive? sneakyimp Linux - Software 2 09-18-2007 09:53 PM
LXer: MySQL Backup And Recovery With mysql-zrm On Debian Sarge LXer Syndicated Linux News 0 09-28-2006 08:21 AM

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

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