The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Redhat linux command to check Version bache_gowda UNIX for Dummies Questions & Answers 1 03-22-2007 11:09 PM
Loading values into a MYSQL database kshelluser Shell Programming and Scripting 2 12-05-2006 11:10 AM
command(s) to find size of mysql database? sbourgeois UNIX for Dummies Questions & Answers 4 06-11-2006 09:40 PM
mysql installation error using redhat 7.2 theDirtiest UNIX for Dummies Questions & Answers 6 11-15-2001 12:41 PM
mysql in redhat gparsons70 UNIX for Dummies Questions & Answers 13 10-31-2001 03:10 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-19-2004
Registered User
 

Join Date: Sep 2001
Posts: 67
MYSQL command to take a backup of the database in Redhat linux 7.2

I am new to mysql database ,

we have a mysql database running on linux , and we use mysql database for bugzilla, so we wanted to take a backup .

what is the command for taking the entire database backup
from the command prompt with all options.


Thanks in advance
Bache Gowda
Forum Sponsor
  #2  
Old 01-20-2004
jsilva's Avatar
Registered User
 

Join Date: Apr 2003
Posts: 169
Hi,

Use the mysqldump command...

The argument for a full backup is -A... do mysqldump --help.
  #3  
Old 01-20-2004
Registered User
 

Join Date: Sep 2001
Posts: 67
Quote:
Originally posted by jsilva
Hi,

Use the mysqldump command...

The argument for a full backup is -A... do mysqldump --help.
Thanks, my another problem is how to make sure backup file is proper or not.
I userd the command to take backup us mysqldump -A -p --password=***** >back.sql

backup.sql file created but file having lot of junk character. How to make sure?

Bache Gowda
  #4  
Old 01-21-2004
jsilva's Avatar
Registered User
 

Join Date: Apr 2003
Posts: 169
It's not suppose to have "junk", because it's a text file... maybe the command is corrupted or you have some weird data on your tables...
Use mysqlcheck to check your DBs before the dump...
  #5  
Old 01-21-2004
photon's Avatar
Registered User
 
Join Date: Jul 2002
Posts: 146
Here is a way to email a backup using bash, perl, and crontab.

mysqlbackup

Code:
#!/bin/sh 
mysqldump -uroot -ppwd --opt db1 > /sqldata/db1.sql 
mysqldump -uroot -ppwd --opt db2 > /sqldata/db2.sql 
cd /sqldata/ 
tar -zcvf sqldata.tgz *.sql 
cd /scripts/ 
perl emailsql.cgi
Use perl to send a MIME email.

emailsql.cgi

Code:
#!/usr/bin/perl -w 
use MIME::Lite; 
$msg = MIME::Lite->new( 
From => 'mysqlbackup@yoursite.com', 
To => 'you@yoursite.com', 
Subject => 'sqldata.tgz MySQL backup!', 
Type => 'text/plain', 
Data => "Hi You,\n MySQL database backups.");
 
$msg->attach(Type=>'application/x-tar', 
Path =>"/sqldata/sqldata.tgz", 
Filename =>"sqldata.tgz"); 

$msg->send;
Use crontab –e to edit your schedule to run at 2 am every day.

0 2 * * * * /myscripts/mysqlbackup
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0