472,373 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 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 2167
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.