FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 12-04-2007, 10:11 AM
"Indunil Jayasooriya"
 
Default Help to restore mysql data on CentOS 5

Hi ,

Help is needed* to restore mysql data

This is the the setup.

2 Servers running on CentOS.

one server has both apache an mysql.

the other server only has mysql database. This server has about 12000 records in the database. Last week, It had* about 6000 records. then, Someone has* backed up these 6000 records to the web server. Now , We need to backup all 12000 records to the webserver.


How to archive this task?

If I restore these 12000 records to the web server, it already has 6000 records. Then, whall will happen? Shoud I override them?

Remember, this is a PRODUCTION SERVER.. I should do it properly.



I think I will have to do following steps.

first, I will have to dump the mysql server backup from database server.

This is the command I will have to enter from the database server.




mysqldump -u root -p databasename >
database.txt


then, I will have to mount a flash drive and copy database.txt to the flash drive.

Then, I will have to go to the web server and mount it there.

Then, finnaly, I have to restore
database.txt to web server as follows.


mysql -u root -p databasename < databas.txt


Am I RIGHT?

This data is extremely essential. I should be able to do it properly.

Any IDEAS?


--
Thank you

Indunil Jayasooriya




--
Thank you
Indunil Jayasooriya

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-04-2007, 11:01 AM
Tomasz 'Zen' Napierala
 
Default Help to restore mysql data on CentOS 5

Tuesday 04 December 2007 12:11:50 Indunil Jayasooriya napisaƂ(a):

[snip]
> I think I will have to do following steps.
>
> first, I will have to dump the mysql server backup from database server.
>
> This is the command I will have to enter from the database server.
>
>
> * mysqldump -u root -p databasename > database.txt*

You might want to add --add-drop-table to your mysqldump

> then, I will have to mount a flash drive and copy *database.txt* to the
> flash drive.
>
> Then, I will have to go to the web server and mount it there.
>
> Then, finnaly, I have to restore *database.txt* to web server as follows.
>
> *mysql -u root -p databasename < databas.txt*
>
> Am I RIGHT?

Is second DB RW or RO?

> This data is extremely essential. I should be able to do it properly.

Most production data is extremely essential

Regards,
--
Tomasz Napierala
System Administrator
QXL Poland - Allegro.pl Team
http://www.allegro.pl/
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-04-2007, 01:31 PM
"Jim Perrin"
 
Default Help to restore mysql data on CentOS 5

On Dec 4, 2007 6:11 AM, Indunil Jayasooriya <indunil75@gmail.com> wrote:

> mysqldump -u root -p databasename > database.txt

You might also want to use -Qc, so that you quote the data and do
complete inserts. This depends mostly on the version of mysql that
you're running, which I didn't see in your initial post. Better safe
than sorry.


--
During times of universal deceit, telling the truth becomes a revolutionary act.
George Orwell
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 12:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org