472,146 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Can i replace the files MYI MYD and FRM to update a database?

Hello:

Can i update a MySQL database with just copy the files MYI MYD and FRM
in the right dir? I know this work. The question is how MySQL manage
the user that are usig that database in that moment. Can i close all
the connection to that database? How can i tell MySQL deamon that
donīt use that database any more?
Thank you in advance.
Carlos
Jul 23 '05 #1
2 3810
Carlos Eduardo Peralta wrote:
Hello:

Can i update a MySQL database with just copy the files MYI MYD and FRM
in the right dir? I know this work.
This is not safe to do in general. MySQL might have data in memory that
it expects to write to the files. Changing the files outside of control
of mysqld creates a risk of losing unsaved data. If this has worked for
you in the past, I would describe this as, "you haven't lost any data
_yet_."

I recommend that everyone use the backup & restore tools to update a
database. Read this page and its sub-sections:
http://dev.mysql.com/doc/mysql/en/di...revention.html
The question is how MySQL manage
the user that are usig that database in that moment. Can i close all
the connection to that database? How can i tell MySQL deamon that
donīt use that database any more?


If you need to forcibly disconnect a user connection from a running
database, to prepare it for maintenance, read these pages:

Using the command-line interface:
http://dev.mysql.com/doc/mysql/en/kill.html

Using MySQL Administrator GUI interface:
http://dev.mysql.com/doc/administrat...nnections.html

Regards,
Bill K.
Jul 23 '05 #2
"Bill Karwin1" wrote:
Carlos Eduardo Peralta wrote:
Hello:

Can i update a MySQL database with just copy the files MYI

MYD and FRM
in the right dir? I know this work.


This is not safe to do in general. MySQL might have data in
memory that
it expects to write to the files. Changing the files outside
of control
of mysqld creates a risk of losing unsaved data. If this has
worked for
you in the past, I would describe this as, "you haven't lost
any data
_yet_."

I recommend that everyone use the backup & restore tools to
update a
database. Read this page and its sub-sections:
http://dev.mysql.com/doc/mysql/en/di...revention.html
The question is how MySQL manage
the user that are usig that database in that moment. Can i

close all
the connection to that database? How can i tell MySQL deamon

that
donīt use that database any more?


If you need to forcibly disconnect a user connection from a
running
database, to prepare it for maintenance, read these pages:

Using the command-line interface:
http://dev.mysql.com/doc/mysql/en/kill.html

Using MySQL Administrator GUI interface:
http://dev.mysql.com/doc/administrat...nnections.html

Regards,
Bill K.


Bill,

Backup /restore work fine for smaller databases. For larger
databases, they bring the server down to its knees. Then I think it
is actually better to take the disk image, and back it up. Of course,
mysqld has to be totally shutdown (good or bad depending on what is
being done with the mysql...). Tar’ing when others are chaning the
data is not good.

In answer to Carlos, you can shutdown mysqld if you have root access.

--
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-replac...ict213566.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=741483
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Craig Keightley | last post: by
5 posts views Thread by Brian | last post: by
1 post views Thread by Jeffrey | last post: by
6 posts views Thread by simon.robin.jackson | last post: by
reply views Thread by Saiars | last post: by

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.