473,320 Members | 1,868 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,320 software developers and data experts.

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 1864
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_name <
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.com> wrote in message
news:_J*****************@newsread1.news.atl.earthl ink.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
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...
1
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...
9
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...
9
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
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...
1
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...
0
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...
5
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...
1
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...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.