473,625 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ 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 3892
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
3020
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 applications Set news_article = replace(news_article, '<FONT face="Times New Roman" color=#000000 size=3>', ''); Update applications Set news_article = replace(news_article, '<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">', ''); Update...
2
14904
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 in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and the data that I am pulling into it. I just have one challenge that may require a lot of work and I...
5
3413
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. There are 15 files created each month with each file containing specific data. What I started to do is store the files by year and then by month so I new when the data is based on. I have linked the table to the database and them append the...
7
1591
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 that function, and replace the current function's info with new function info? Example of what I need... (1) Open the "frmClients" form in design view. (I can do already). (2) Find the code behind the OnClick property of btnPrintHistory.
1
1469
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 few dozen HTML files. While I already plan to use RegEx to do the actual replacement, what should I be doing to open, update, and save each of the files. What would be an efficient way to do this? I'm seeing that .NET has a File class,...
4
2186
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 inside an array variable. 2- Loop through each table name inside the array 1 to 1000 tables
4
23030
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 method (ReadFile). I'm going to use this to edit the file paths in all of my WMP play lists. When I run this the string variable is not being changed using the replace method. Here's what I have: Private Sub ReadFile(ByVal path As String)
20
4253
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 is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
6
2226
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 button that does this all for me. In my head the method should go something like this:
0
8251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.