473,414 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

database backup - how to?

How do I synchronize MySQL table data of my home PC with latest data
from a remote server ?

My home PC is on a very slow internet connection, so implementing
replication will cause long time read lock on remote server, which is
not desirable.

What are the tools for manual sync of tables ?

I'm running FreeBSD on my home PC.

Mike

Jul 23 '05 #1
12 2247
siliconmike wrote:
What are the tools for manual sync of tables ?


If the size of database is not too big:

Use mysqldump to create dump of the whole database. Use gzip or similar
tool to make it smaller for the transfering. On your computer, unzip it
and read it in using mysql-command line tool.

You can use mysqldump to get only given tables, in case you habe very
large static table and few small dynamic tables.
Jul 23 '05 #2


Aggro wrote:
siliconmike wrote:
What are the tools for manual sync of tables ?


If the size of database is not too big:

Use mysqldump to create dump of the whole database.


Oh O! The tables are Biiiiiiiiiiiiiiiigggggggg!!

Jul 23 '05 #3
siliconmike wrote:
How do I synchronize MySQL table data of my home PC with latest data
from a remote server ?

My home PC is on a very slow internet connection, so implementing
replication will cause long time read lock on remote server, which is
not desirable.

What are the tools for manual sync of tables ?

I'm running FreeBSD on my home PC.

Mike


Mike,

If you can modify the programs on the server have them write the
SQL statements that insert or update your server database to a
flat file. Download the flat file and run it against your home
PC database.

As long as every SQL statement is terminated with a semi-colon
you can execute the contents of your flat file using:

mysql -u user_name database_name < flat_file_name

HTH

Jerry

Jul 23 '05 #4
<si*********@yahoo.com> ecrivait/schrieb/wrote:
Use mysqldump to create dump of the whole database.


Oh O! The tables are Biiiiiiiiiiiiiiiigggggggg!!


even if you compress them with bzip2/gzip? (generaly work
quite well on dumps).

Olivier

--
__________________________________________________ _______________
Olivier M. - sp**********@8304.ch - PGP: 0E84D2EA - Switzerland
Jul 23 '05 #5
Sounds good. But I would prefer another approach - putting a column
called NEEDS_BACK_UP in each remote table to keep track of whether a
record needs to be backed up.

In what you advise, probably a failed sql statement in a flat file
might leave the rest of the sql statements meaningless.

Although, my scheme I guess needs considerable change in my code.

Or there is another scheme - updated-timestamp in each remote table...

Mike

jerry gitomer wrote:
Mike,

If you can modify the programs on the server have them write the
SQL statements that insert or update your server database to a
flat file. Download the flat file and run it against your home
PC database.

As long as every SQL statement is terminated with a semi-colon
you can execute the contents of your flat file using:

mysql -u user_name database_name < flat_file_name

HTH

Jerry


Jul 23 '05 #6
Olivier M. wrote:
<si*********@yahoo.com> ecrivait/schrieb/wrote:
Use mysqldump to create dump of the whole database.


Oh O! The tables are Biiiiiiiiiiiiiiiigggggggg!!


even if you compress them with bzip2/gzip? (generaly work
quite well on dumps).


The site will initially have 2 GB tables, which will grow..

Jul 23 '05 #7
siliconmike wrote:
In what you advise, probably a failed sql statement in a flat file
might leave the rest of the sql statements meaningless.


No, if you use --force parameter (if I remember the syntax correctly),
which will force it continue after errors also.
Jul 23 '05 #8


Aggro wrote:
siliconmike wrote:
In what you advise, probably a failed sql statement in a flat file
might leave the rest of the sql statements meaningless.


No, if you use --force parameter (if I remember the syntax correctly),
which will force it continue after errors also.


What I mean is that there is no meaning to continue backup in case a
sql command fails. Because some of the future sql commands might be
depending on the result of the one that failed. The backup-data then
wouldn't be equivalent to the original one.

Jul 23 '05 #9
"" wrote:
How do I synchronize MySQL table data of my home PC with
latest data
from a remote server ?

My home PC is on a very slow internet connection, so
implementing
replication will cause long time read lock on remote server,
which is
not desirable.

What are the tools for manual sync of tables ?

I'm running FreeBSD on my home PC.

Mike


I have followed this thread...

but have a basic question..

Why do you want to ’synchronize’ db with your home pc? Since you
mention slow connection, you obvisouly only using your home pc for
back. Then there are no stringent requiremetns for synch’ing. All
you need is simple backups, which have been amply explained.

By the way, on a 2Gig DB, the best approach is mysqlhotcopy, if you
have root access. All the other approaches can be problematic:
mysqldump can fail on big db’s, and taring the files directly fails
too, since the files may be updating in middle of tar.

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/mySQL-databa...ict237213.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=824569
Jul 23 '05 #10
steve wrote:
"" wrote:
> How do I synchronize MySQL table data of my home PC with
> latest data
> from a remote server ?
>
> My home PC is on a very slow internet connection, so
> implementing
> replication will cause long time read lock on remote server,
> which is
> not desirable.
>
> What are the tools for manual sync of tables ?
>
> I'm running FreeBSD on my home PC.
>
> Mike
I have followed this thread...

but have a basic question..

Why do you want to 'synchronize' db with your home pc?


To keep the new data posted by people on the website server, so that in
case the server crashes, I have a copy.

Since you mention slow connection, you obvisouly only using your home pc for
back. Then there are no stringent requiremetns for synch'ing. All
you need is simple backups, which have been amply explained.

By the way, on a 2Gig DB, the best approach is mysqlhotcopy, if you
have root access.
Correct me- but mysqlhotcopy acquires read locks, and since I'm on a
slow connection, long time read locks would prevent other threads from
reading the tables while it is being backed up.. right?

All the other approaches can be problematic: mysqldump can fail on big db's, and taring the files directly fails
too, since the files may be updating in middle of tar.


Jul 23 '05 #11
siliconmike wrote:
Correct me- but mysqlhotcopy acquires read locks, and since I'm on a
slow connection, long time read locks would prevent other threads from
reading the tables while it is being backed up.. right?


Can you not create the copy to the server. After copy is ready, then
transfer it to your home computer?
Jul 23 '05 #12
"" wrote:
steve wrote:
"" wrote:
> How do I synchronize MySQL table data of my home PC with
> latest data
> from a remote server ?
>
> My home PC is on a very slow internet connection, so
> implementing
> replication will cause long time read lock on remote server, > which is
> not desirable.
>
> What are the tools for manual sync of tables ?
>
> I'm running FreeBSD on my home PC.
>
> Mike


I have followed this thread...

but have a basic question..

Why do you want to 'synchronize' db with your home pc?


To keep the new data posted by people on the website server,
so that in
case the server crashes, I have a copy.

Since you
mention slow connection, you obvisouly only using your home

pc for
back. Then there are no stringent requiremetns for

synch'ing. All
you need is simple backups, which have been amply explained.

By the way, on a 2Gig DB, the best approach is mysqlhotcopy,

if you
have root access.


Correct me- but mysqlhotcopy acquires read locks, and since
I'm on a
slow connection, long time read locks would prevent other
threads from
reading the tables while it is being backed up.. right?

All the other approaches can be problematic:
mysqldump can fail on big db's, and taring the files

directly fails
too, since the files may be updating in middle of tar.


mysqlhotcopy works on the remote server itself (again assuming you
have root access). It takes care of all the locking, so that a live
database can be backed up. If you, instead, use TAR or mysqldum, you
will notice that the db will be brought down to its feet.

Backups can be had for very cheap these days, a few dollars a month.
There is no reason to back up over slow lines to your local PC. Just
backup over high speed to a 3rd party location. Try GNAX, you can
back up your 2Gig for $1.00 !! a month
http://www.gnax.net/backup/index.php

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/mySQL-databa...ict237213.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=824634
Jul 23 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Cristina | last post by:
Hallo i am a beginner into Oracle Technologies.I would like to make backup of my database,but i dont know how.Is there tools?Can i schedule the backup plan? thanks Cristina
2
by: Rajesh Garg | last post by:
I will make it simpler to look... I have DB1 - as backup for day 1 LOg1 as backup of logs T1 T2 T3 T4 T5 ...some transaction on day 2 Now i backup again DB2 Log2
6
by: Edwinah63 | last post by:
Hi Gurus, i am having problems with restoring a ms sql database. i have restored the database using veritas to a different location ('g:\datafiles') in no recover mode. when i view the...
2
by: trotter | last post by:
I want to know if there is a "best-practice" for setting up Database Maintenance Plans in SQL Server 7 or 2000. To be more specific, I want to know the order in which I complete the tasks. Do I...
2
by: Matt | last post by:
I run SQL Server 2000 and use thier database maintenance plans to backup my databases. My questions is what happens if a change is being made to a database table while a backup is running? Should I...
5
by: Hassan Naqvi | last post by:
Hi, Basically, I am Java developer. In past I have played with Oracle using Java (JDBC). But this is the time to play with IBM DB2 using Java (JDBC). So kindly help this DB2 newbie. I have a...
5
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup...
5
by: Steve | last post by:
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. ...
3
by: Bill E. | last post by:
I'm trying to restore a database backed up a production machine onto my development machine. I don't want to restore the transaction logs (there are two) because they are far too large and are...
5
by: Roger | last post by:
backup log testdb with truncate_only DBCC SHRINKFILE (testdb_log, 100) WITH NO_INFOMSGS backup database testdb to disk = '\\DC01\Backups\DB01\testdb.bak' with init and does the shrinkfile...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.