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
2 Answers
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
-
-
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) Oct 5, 2012 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: