|
-
Feb 10th, 2007, 05:26 PM
#1
Thread Starter
Addicted Member
Moving MySQL database from one computer to another
Hello,
I may be asking this in the wrong category but since I use MySQL with PHP I think this is the closest. How can I move MySQL databases from one computer to another? If I simply copy the whole MySQL folders or some of its folders and paste it on the other computer would it be sufficient?
Thanks
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Feb 10th, 2007, 07:17 PM
#2
Re: Moving MySQL database from one computer to another
it would be best to make a MySQL dump of all the contents. I'm not sure if copying the folders would be good enough.
you can make a MySQL dump using various administration programs/interfaces, including phpMyAdmin (which is what I would suggest). There's also a command that will do this for you, I believe, but it seems to escape me at this time. there was another thread about this a couple of months ago I believe, so if you search this forum for "sql dump" or just "dump," you might be able to find some references.
-
Feb 11th, 2007, 12:38 AM
#3
Junior Member
Re: Moving MySQL database from one computer to another
I will suggest, export all data to SQL (maybe use phpMyAdmin), and import into new database
-
Feb 11th, 2007, 05:53 AM
#4
Re: Moving MySQL database from one computer to another
that's what a MySQL dump is.
-
Feb 11th, 2007, 06:08 AM
#5
Re: Moving MySQL database from one computer to another
Code:
$ mysqldump -u <user> -p<password> <database> > dumpfile.sql
The last > is literal. That's the command on Unix systems.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 12th, 2007, 12:55 AM
#6
Re: Moving MySQL database from one computer to another
-
Nov 13th, 2008, 03:06 AM
#7
Fanatic Member
Re: Moving MySQL database from one computer to another
 Originally Posted by penagate
please how do i get through this dump on windows?
as the mysqldump returned an empty result.
i have MySQL 5.0.51b
thanks
-
Nov 13th, 2008, 04:03 AM
#8
Re: Moving MySQL database from one computer to another
 Originally Posted by modpluz
please how do i get through this dump on windows?
as the mysqldump returned an empty result.
i have MySQL 5.0.51b
thanks
This command will produce a mysqldump on Windows:
Code:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump" -u myuser --password=mypass mydbname > C:\database.sql
Be sure to change the mysql path to your path and the user/pass.
Last edited by the182guy; Nov 13th, 2008 at 11:54 AM.
Chris
-
Nov 13th, 2008, 10:33 AM
#9
Frenzied Member
Re: Moving MySQL database from one computer to another
Did the advice work out for you? Having same troubles.
-
Nov 13th, 2008, 11:57 AM
#10
Re: Moving MySQL database from one computer to another
I editted my post with different code. I have just tested this on my system which worked:
Code:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump" -u myuser --password=mypass db > C:\database.sql
That will create an SQL file with the dump in, in c:\
Be sure to change the path to your mysql bin directory. Change myuser to your username, mypass to your password and mydb to your database name.
-
Nov 13th, 2008, 08:16 PM
#11
Re: Moving MySQL database from one computer to another
If you specify the -p option with no password you will be prompted to type it into the standard input of the mysqldump utility which is safer than having it logged in your shell's history.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|