The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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-23-2007 02:09 AM
Loading values into a MYSQL database kshelluser Shell Programming and Scripting 2 12-05-2006 02:10 PM
command(s) to find size of mysql database? sbourgeois UNIX for Dummies Questions & Answers 4 06-12-2006 12:40 AM
mysql installation error using redhat 7.2 theDirtiest UNIX for Dummies Questions & Answers 6 11-15-2001 03:41 PM
mysql in redhat gparsons70 UNIX for Dummies Questions & Answers 13 10-31-2001 06:10 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-20-2004
bache_gowda bache_gowda is offline
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
  #2 (permalink)  
Old 01-20-2004
jsilva's Avatar
jsilva jsilva is offline
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 (permalink)  
Old 01-21-2004
bache_gowda bache_gowda is offline
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 (permalink)  
Old 01-21-2004
jsilva's Avatar
jsilva jsilva is offline
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 (permalink)  
Old 01-21-2004
photon's Avatar
photon photon is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 162
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 01:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0