Page 1 of 1

Backing Up MySQL Databases + tables

Posted: Fri Oct 15, 2004 2:02 am
by volkan
Hi
is there no way/program to backup MySQL Data? i need to re-format my server, and i need to save this info.

Can you help?
Cheers
Volkan

Posted: Fri Oct 15, 2004 3:04 am
by phpScott
how big is your db. if it isn't to big and have phpMyAdmin installed then you can just use that to back up each individual db.

other wise look to the command line and use[mysql_man]mysqldump.html[/mysql_man] to back up your date.
I did a search on mysql.com for backing up database and there where a couple of other options as well.

Posted: Fri Oct 15, 2004 3:08 am
by mudkicker
Hi Volkan, at most hosting contorl panels there is a backup section. You can do a database backup from this section, I think.

Posted: Fri Oct 15, 2004 11:29 am
by volkan
ooo, i think i found a way.
Is this possible:


going into the msql install root eg c:\server\mysql\

and making a copy on the folder called 'data' as in this i see folders of my databases.

Posted: Fri Oct 15, 2004 11:42 am
by mudkicker
but you cannot do it in your host.

Posted: Fri Oct 15, 2004 11:44 am
by volkan
it is my server!!!

Posted: Fri Oct 15, 2004 11:45 am
by mudkicker
oh, then you can :)

Posted: Fri Oct 15, 2004 11:48 am
by volkan
Cheers!

Posted: Fri Oct 15, 2004 12:32 pm
by volkan
ok thanks that is done, and while i was at it, i installed a new version of phpmyadmin

however in this version, im not sure how to change DBs username + pword

Posted: Sat Oct 16, 2004 12:18 pm
by WaldoMonster
volkan wrote:ooo, i think i found a way.
Is this possible:


going into the msql install root eg c:\server\mysql\

and making a copy on the folder called 'data' as in this i see folders of my databases.
Yes that is possible :)
Don't forget to first stop the MySQL service.

Code: Select all

net stop mysql
Or go to Control panel > Administrative Tools > Services and stop the MySQL service.

I use a batch file to make a backup this way.
It looks something like this:

Code: Select all

net stop mysql
"d:\Console\rar\rar.exe" u -r0 -as D:\Backup\Data_C.rar @D:\Backup\drive_c.txt
"d:\Console\rar\rar.exe" rr5 D:\Backup\Data_C.rar
"d:\Console\rar\rar.exe" u -r0 -as D:\Backup\Data_D.rar @D:\Backup\drive_d.txt
"d:\Console\rar\rar.exe" rr5 D:\Backup\Data_D.rar
net start mysql

Posted: Mon Oct 18, 2004 11:47 am
by volkan
ok thanks but how do i add a username + pword for the DB

Posted: Mon Oct 18, 2004 3:07 pm
by m3mn0n
Wow, I was just about to post a welcome back reply until I looked more closely and realized your name was "volkan" and not "volka". :(

Oh well, I guess i'll have to wait for the welcome back reply. ;)

Posted: Mon Oct 18, 2004 3:59 pm
by mudkicker
in phpmyadmin there should be a file config.inc.php you change the configuration from there.

backup mySQL

Posted: Tue Oct 19, 2004 5:45 am
by DepecheM
You can use the Mysql Administrator program that has an automatic and schedule backup project :P so you can backup your database whenever you want!

for the easy way you can copy from the /mysql/data/youtdatabase all the files!

:mrgreen:

Posted: Mon Oct 25, 2004 11:50 pm
by ibizconsultants
Hi Volkan,

You can use the following command on your prompt to backup the entire database along with tables:

mysqldump -u username -p dbname -h hostname > backup.sql

Note: use the "-u hostname" if you do not connect to mysql using localhost.

to restore it back to the server you need to first create the database and assign the necessary rights and the use the following on your prompt

mysql -u username -p dbname -h hostname < backup.sql

Note: again use the "-u hostname" if you do not connect to mysql using localhost.

Hope this helps

Thanks
iBizConsultants
http://www.ibizconsultants.com