473,465 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3884
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
5
by: Brian | last post by:
I need to import data from 720 csv files into an Access database so I can do some editing prior to loading into a SQL Server. These files came from data output from a mainframe on a monthly basis....
7
by: Access2003Guru | last post by:
Instead of sending an entire form to a client that includes code changes, I'm trying to update just one section of code. If I know the object, function name & property, is there a way to search...
1
by: Jeffrey | last post by:
I would appreciate suggestions for a general strategy I could use to update a bunch of HTML files. Specifically I need to replace sevaral instances of one string with another string in each of a...
4
by: serge | last post by:
I managed to put together C# code and have it do the following: 1- Get all the table names that start with the letter "Z" from sysobjects of my SQL 2000 database and put these table names...
4
by: moondaddy | last post by:
I need to edit the text in many files so I'm writing a small routine to do this. First I have a method that loops through all the files in a directory and passes the full file path to another...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
6
by: simon.robin.jackson | last post by:
Ok. I need to develop a macro/vba code to do the following. There are at least 300 corrections and its expected for this to happen a lot more in the future. Therefore id like a nice...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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 ...

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.