Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a localhost (XAMPP) on an old pc. I need the MySQL database on my new mac with a localhost (MAMP). Issue is, pc doesn't have internet connection. Any way I can move the database over? Detailed instructions are highly welcomed as I am by no means a server expert. Thanks

share|improve this question

closed as off topic by Zoredache, dmourati, rnxrx, Michael Hampton, Scott Pack Oct 8 '12 at 1:57

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Use a USB stick? –  Michael Hampton Oct 5 '12 at 4:11

2 Answers 2

You should be able to just use a USB Stick as suggested in the comments above. Just make sure to remove/modify the permissions on the DB file(s) first to avoid having issues with not being able to access the DB once it is moved over. That is a painful, painful, painful lesson if something goes wrong... experience talking.

  • Backup MySQL
  • Consequently, use the import link on the new PC
share|improve this answer
    
I assumed XAMP = Windows MAMP = Mac –  sxw123 Oct 5 '12 at 5:36
    
I've not seen it referred to as MAMP =D As a SQA tester I've used it on both Mac and Windows so was just wanting to clarify and was pretty sure that apache friends just called it XAMP for each os(win/mac/linux) –  Angel Brighteyes Oct 5 '12 at 19:34

XAMP should have phpmyadmin installed. If so, I would use it to create a backup / dump of the data base. Put that on your usb, move it to the mac, and again use phpmyadmin to first create a data base, then import your data.

You could also use mysqldump (at least on Linux from command line. Not sure about XAMP on windows):

mysqldump -u username -p database | gzip > database.sql.gz ( the pipe gzip is optional)

so say your db name is db_important and your db username is phil

mysqldump -u phil -p db_important | gzip > db_important.sql.gz

( when you run this you will be asked for your db password)

Or wihout gzip:

mysqldump -u phil -p db_important > db_important.sql

phpmyadmin should be easiest and safest route for you if your unfamiliar with mysql command line

these links may help:

back up with php admin

how to use phpmyadmin to back up and restore

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.