Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

myd export from server

Posted on 2009-04-06
11
Medium Priority
?
460 Views
Last Modified: 2012-05-06
Can anyone tell me how to get the .myd,.frm,.myi file from the server.Also tell me how to restore that files to the new database.
0
Comment
Question by:coolguy2009
  • 6
  • 4
11 Comments
 
LVL 5

Expert Comment

by:ModarHijazi
ID: 24075877
The easiest way is:
1) Stop the MySQL Service.
You can do it from the console:
net stop mysql

2) Copy the data folder (replace DATABASE with your database name)
%programfiles%\MySQL\MySQL Server 5.0\data\DATABASE

3) Put it in the new server

4) Restart the service
net start mysql
0
 
LVL 5

Expert Comment

by:ModarHijazi
ID: 24075883
And of course you can use the export/import features in "MySQL Administrator" in  the GUI package:
downloadable from:
http://dev.mysql.com/downloads/gui-tools/5.0.html

0
 

Author Comment

by:coolguy2009
ID: 24076117
Hi,

I only have the access to the server.How to do it.

Please tell me....It is a unix box.

Thanks
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 5

Expert Comment

by:ModarHijazi
ID: 24076174
It's much easier u can use the internal dumb

http://www.unixnewbie.org/how-to-backup-and-restore-mysql-database/

To dump the database onto a text file: mysqldump database_name > database_name.sql

To import the data into a database: mysql database_name < database_name.sql

Replace database_name with the name of your database.
0
 
LVL 5

Expert Comment

by:ModarHijazi
ID: 24076528
BTW, just to be clear the 2nd method works even on Windows, but when the database is very huge, i usually use the manual method (1st method) for performance issues only.
0
 

Author Comment

by:coolguy2009
ID: 24076650
It is a window server .SO please tell me on that perspective...
0
 

Author Comment

by:coolguy2009
ID: 24077395
Hi i go to the path u said and in their i found a database name and when i opened that folder it contains many files .All are .frm file

Is that enough for restoring the data.
0
 
LVL 5

Expert Comment

by:ModarHijazi
ID: 24077561
If it's not very huge database i suggest using the 2nd method

To dump the database onto a text file: mysqldump database_name > database_name.sql

To import the data into a database: mysql database_name < database_name.sql

and this will make all for even the drop and create commands and it will lock the database while restoring it, but if you prefer the manual method don't forget to stop the service to be sure that all of the changes is written in the files then copying the files is enough.

0
 

Author Comment

by:coolguy2009
ID: 24078693
Hi,

The old database name is test99.

Now i created a new database name as test99.

But it has only the structure.But my old database only having the datas.

So i can use ur 2nd method query right?

Is i need to stop the mysql server?

Also where i need to run ur query?

Thanks
0
 
LVL 5

Accepted Solution

by:
ModarHijazi earned 1500 total points
ID: 24084607
It will contain everything EVEN THE DATA, and you don't need to stop the server.
You need to run EVERYTHING from the command console:
In the following example i assumed that from the original server you have run the dump:

run -> cmd

cd %programfiles%\MySQL\MySQL Server 5.0\bin
mysqldump test99 > Test99DBscript.sql

___________________________________________
after finishing the first step you will find a file called Test99DBscript.sql in the folder %programfiles%\MySQL\MySQL Server 5.0\bin, that you need to copy to the new server then:

run -> cmd

cd %programfiles%\MySQL\MySQL Server 5.0\bin
mysql test99 < Test99DBscript.sql

___________________________________

And voila everything is perfect.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question