473,795 Members | 3,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Backing up

Ike
I am running off of a MySQL database on a remote server. I am truly
concerned about backup. I have phpMyAdmin running on the remote server, and
I see I can "Export" to various formatsd from there, but nothing to "Import
if I need to reinstate my data.

How do you typically backup a MySQL database? Cant I simply copy the files?
How does one do this if I want, say, to backup the files from the remote
server, to my local harddrive? Thanks, Ike
Jul 19 '05 #1
2 1883
Ike wrote:
I am running off of a MySQL database on a remote server. I am truly
concerned about backup. I have phpMyAdmin running on the remote server, and
I see I can "Export" to various formatsd from there, but nothing to "Import
if I need to reinstate my data.

How do you typically backup a MySQL database? Cant I simply copy the files?
How does one do this if I want, say, to backup the files from the remote
server, to my local harddrive? Thanks, Ike


You can either export via phpMyAdmin or via the mysql-dump command.
(See: http://www.mysql.com/doc/en/Backup.html for more details).

Then you can recover it by using 'mysql your_database_n ame <
dumpfile.sql' (without the quotes) Or via PHPMyAdmin, but you have to
read the docs for that.

HTH,
Boomerang
Jul 19 '05 #2
"Ike" <rx*@hotmail.co m> wrote in message
news:_J******** *********@newsr ead1.news.atl.e arthlink.net...
I am running off of a MySQL database on a remote server. I am truly
concerned about backup. I have phpMyAdmin running on the remote server, and I see I can "Export" to various formatsd from there, but nothing to "Import if I need to reinstate my data.

How do you typically backup a MySQL database? Cant I simply copy the files? How does one do this if I want, say, to backup the files from the remote
server, to my local harddrive? Thanks, Ike


Hi Ike. I answered this question in another group a while back. I'll
repost it here.

First, have a look at mysqldump, a utility for dumping the databases for
backup that comes with MySQL. Also, depending on your situation, you may
be able to back it up like so:
1. Stop the MySQL server ('/etc/init.d/mysql stop' on my servers)
2. Copy, zip, tar, whatever... the actual database files. There will be a
directory for each database, containing a.frm, a .MYD and a .MYI file for
each table. Simply make a copy of the entire directory structure.
3. Restart the MySQL server ('/etc/init.d/mysql start' on my servers)

Easy as 1-2-3!

I can do it this way because my servers are not in use except during the
day, so I can shut them down in the evenings for backup. Restoring a
crashed server is as simple as setting up a new Red Hat (or your flavor of
choice) box with MySQL and copying the directory structure back into it. It
also makes it very easy to restore a single table within a database (just
stop the server and copy the three files associated with the table you
want.) You have to mind the file ownerships and permissions, but otherwise
it works like a charm.

I use a simple script, kicked off automatically each night by a cron job:
#
# Backup the databases
#
/etc/init.d/mysql stop
prefix=`eval date +%d`
suffix=tar.gz
backupfilename= $prefix.$suffix
tar -cvzf /backups/$backupfilename /data/databases /data/scripts
/data/shared /data/wwwroot/htdocs
/etc/init.d/mysql start

This script creates a file for each day of the month, overwriting the one
from the previous month. So, you will have a maximum of 31 files named
01.tar.gz ... 31.tar.gz that each contain the entire MySQL database
including all the users, etc and anything else you care to add to the
backup. Obviously this method has some limitations, and would not work for
everyone, but it has worked well for me.
HTH - JM


Jul 19 '05 #3

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

Similar topics

5
1969
by: mark | last post by:
Hi I'm hoping that some could point me in the right direction for "best practice" in: 1) securely backing up a complete sql7 and 2000 server containing many databases. 2) backing up an individual database
1
1287
by: Hlpl | last post by:
Hi I have a VB.net windows application that uses an MSDE database I need to give the user the option to backup this data (and later restore it). Ideally I want to back the data up to an empty Access 2000 database that contains the table structure I know that I can do this by stepping through each record of each table in MSDE, inserting them into the correct Access table, but i recon this will take a long time and is not very efficient ...
9
1587
by: J. Frank Parnell | last post by:
hello, i dont know asp at all, but i have been asked to backup a database that is used on a site which uses .aspx. i dont need to do anything with it, just copy it and send it along to someone who will. I have the IP, username, password. i have allready got all the files off the site with ftp, is the database in there? i dont really even know what i'm looking for, but i dont see any .mdb or .sql right off the bat.
9
1597
by: Jerry Porter | last post by:
Is there a way to back up the design changes in a SQL Server database without backing up all the data? It's just test data at this point.
3
1590
by: war_wheelan | last post by:
I am having a problem backing up my database and TLog files due to a lack of local diskspace. The db file is about 30GB and the TLog is about 20GB each on a different hard disk. Each disk doesn't have enough available space to accomadate a backup. I also can't shrink the files because part of that procedure would require a backup. Question: Can I use a redirected drive for the backup media? Is there a way to trick SQL into allowing...
1
1555
by: Pavs | last post by:
This may not be the place to ask however i am looking for resources on how i may document data I am backing up from an oracle database to MS Access. Basically I have my oracle database and i have an Acess database. I have to back up 3 tables from oracle into access. I have no idea how i would document this.
0
1255
by: Lyle Fairfield | last post by:
I have posted previously a procedure for backing up a remote MS-SQL db as text. This is a revised version in Javascript/JScript. This backups data and procedures as XML. My purpose in creating this is to preserve my data in simple form. When one rents a remote MS-SQL db, one may find that getting a backup is more expensive than the renting. One could add other parts, say indexes, of the db to this procedure quite easily. I want only those...
5
1505
by: Stewart Graefner | last post by:
I would like to know if an Access db can be backed up with the push of a command button. I work with extreamly lazy operators who despite crashing their db's still refuse to see the value in backing up their db's. Fools them..but its me that has to undo the boondogal. I would like to be able to put a buttom on the form which will send the a copy of the db to another drive, perhaps a USB stick. Any ideas? *** Sent via Developersdex...
1
1494
by: Martin Schmid | last post by:
I am developing using Visual C#.net. It appears that my web projects create files in both "My Documents\Visual Studio Projects" and ".\inetpub\webroot". Does backing up these files ensure that my code is all backed up? Is there a backup/restore FAQ somewhere? -- Thanks, Martin Schmid, EIT, CCSA, MCDBA, MCSE
0
985
by: Martin Schmid | last post by:
I am developing using Visual C#.net. It appears that my web projects create files in both "My Documents\Visual Studio Projects" and ".\inetpub\webroot". Does backing up these files ensure that my code is all backed up? Is there a backup/restore FAQ somewhere? -- Thanks, Martin Schmid, EIT, CCSA, MCDBA, MCSE
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.