Solved

myd export from server

Posted on 2009-04-06
11
448 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now