mysql

Mad Unix madunix at gmail.com
Thu Sep 4 19:18:50 UTC 2008


HowtoForge stated the following : How To Back Up MySQL Databases Without
Interrupting MySQL
#!/bin/sh
datum=`/bin/date +%Y%m%d-%H`
/usr/bin/mysqladmin --user=root --password=yourrootsqlpassword stop-slave
/usr/bin/mysqldump --user=root --password=yourrootsqlpassword
--lock-all-tables \
      --all-databases > /home/sqlbackup/backup-${datum}.sql
/usr/bin/mysqladmin --user=root --password=yourrootsqlpassword start-slave
for file in "$( /usr/bin/find /home/sqlbackup -type f -mtime +2 )"
do
  /bin/rm -f $file
done
exit 0

On Thu, Sep 4, 2008 at 8:48 PM, Jai Rangi <jrangi at automotive.com> wrote:

> I would not do that,
> 1. Your tables are locked during mysqldump, So if the table size if too
> big then you are without DB at the time of dump on primary.
> 2. I guess you will be (have to if the table structure change) deleting
> all the tables on the secondary server and then copying the data to the
> tables which again takes a while depending on the size of the tables.
>
> Say you setup cron every five minutes then your systems are not in real
> time sync after every 5 minutes, in fact they are never in sync, which
> might not be a big deal for you.
>
> Only way to go for this is Setup replication, which takes hardly 30
> minutes to do. If you can't do it then pay me $150 I will do it for you
> ;) Just joking.
>
> -Jai
>
>
>
> -----Original Message-----
> From: redhat-list-bounces at redhat.com
> [mailto:redhat-list-bounces at redhat.com] On Behalf Of Ryan Golhar
> Sent: Thursday, September 04, 2008 8:13 AM
> To: General Red Hat Linux discussion list
>  Subject: Re: mysql
>
> # dump the database
> mysqldump -u root --password=<password> --databases <list of databases
> to backup> | gzip > /root/backup/mysql.sql.gz
> # copy the gzip file elsewhere
> scp /root/backup/mysql.sql.gz <new location>
>
>
> chaim.rieger at gmail.com wrote:
> > I've used dump and still do on a regular basis. Never failed me yet
> >
> >
> > Sent via BlackBerry from T-Mobile
> >
> > -----Original Message-----
> > From: "Mad Unix" <madunix at gmail.com>
> >
> > Date: Thu, 4 Sep 2008 09:29:31
> > To: General Red Hat Linux discussion list<redhat-list at redhat.com>
> > Subject: Re: mysql
> >
> >
> > However, am thinking to do this script and run it on the colrintab
> >
> > mysqlhotcopy --allowold --flushlog -u <username>
> --password=<password>
> > <dbname> /var/backups/mysql/
> >
> > or
> >
> > /usr/bin/mysqldump -u#### -p#### --all-databases -a >
> > /var/backups/mysql/$(date +%Y%m%d).sql
> > tar cf - /var/backups/mysql/$(date +%Y%m%d).sql | gzip -c >
> > /misc/backups/MySQL/$(date +%Y%m%d).tar.gz
> >
> > Any input about the above....
> >
> > Thanks
> >
> >
> > On Wed, Sep 3, 2008 at 2:43 PM, mark <m.roth2006 at rcn.com> wrote:
> >
> >> Mad Unix wrote:
> >>> I need a script to take Multiple MySql DataBase Backup export Script
> for
> >>> Linux then import them to other server
> >>> to make them symmetric !
> >> export's a std. feature. The real question is hot or cold b/u?
> >>
> >>        mark
> >>
> >> --
> >> redhat-list mailing list
> >> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> >> https://www.redhat.com/mailman/listinfo/redhat-list
> >>
> >
> >
> >
>
> --
>  redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>



-- 
Madunix_at_Gmail
Sysadmin

"Computers are useless. They can only give you answers" - Pablo Picasso
"Never trust a computer you can't throw out a window." - Steve Wozniak



More information about the redhat-list mailing list