Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Moving MySQL Database to a new computer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
noff
Guru
Guru


Joined: 11 Nov 2002
Posts: 388
Location: College Park, Maryland

PostPosted: Sat Nov 29, 2003 8:47 pm    Post subject: Moving MySQL Database to a new computer Reply with quote

I am trying to move my db to my new computer. I really know nothing of databases (this is for mythtv). I don't know how to copy it to a new computer and not lose all of my info.
_________________
What Larry was saying is that if you make it too easy for programmers, then poor programmers will be able to do things best left to good programmers, and will inevitably do them poorly. Everyone will suffer in the long term as a result." - Tom Chance
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Nov 29, 2003 8:58 pm    Post subject: Reply with quote

If you have phpmyadmin, you can dump/export the whole thing into a file and the import it from the new location.

If you dont have phpmyadmin, iam affraid i cant say the exact command how to do it, however i think if you search a little bit on google for export database or something similiar you will probably find some clues.

maybe someone else knows ?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Sat Nov 29, 2003 9:34 pm    Post subject: Reply with quote

If the new computer has a same version of MySQL, you can simply copy the contents of /var/lib/mysql/ (or whatever is the location for your database files) to the new computer and everything's working fine.

But more official way to backup and restore MySQL databases is to use mysqldump, which dumps your databases to text file, which you can later load back to database with

Code:
mysql mydatabase < previously_done_dump.sql


See man page for mysqldump to see more information.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum