View previous topic :: View next topic |
Author |
Message |
noff Guru


Joined: 11 Nov 2002 Posts: 388 Location: College Park, Maryland
|
Posted: Sat Nov 29, 2003 8:47 pm Post subject: Moving MySQL Database to a new computer |
|
|
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 |
|
 |
ikaro Advocate


Joined: 14 Jul 2003 Posts: 2527 Location: Denmark
|
Posted: Sat Nov 29, 2003 8:58 pm Post subject: |
|
|
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 |
|
 |
Janne Pikkarainen Veteran


Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Sat Nov 29, 2003 9:34 pm Post subject: |
|
|
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 |
|
 |
|