myd export from server

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.
coolguy2009Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ModarHijaziConnect With a Mentor Commented:
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
 
ModarHijaziCommented:
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
 
ModarHijaziCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
coolguy2009Author Commented:
Hi,

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

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

Thanks
0
 
ModarHijaziCommented:
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
 
ModarHijaziCommented:
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
 
coolguy2009Author Commented:
It is a window server .SO please tell me on that perspective...
0
 
coolguy2009Author Commented:
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
 
ModarHijaziCommented:
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
 
coolguy2009Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.