Reputation: 29465
I created a database using Mysql Workbench. Now I want to export this database to my home PC.
How can I do this if the 2 PCs have no network connection?
Upvotes: 1
Views: 2318
Reputation: 79
As edit was rejected posting it as an answer; hope it will be helpful. Followed to the queries give by "Marc Hauptmann" -
Few quick-tips for generic issues that can be faced while performing DB dump and restore:-
mysqldump -h [hostname] -u [username] -p [database name] > backup.sql
Upvotes: 1
Reputation: 15669
Using gzip is pretty painless and really shrinks these files.
mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]
gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]
But man, it is 2014 - this stuff is also easy to do via a secure shell connection.
Upvotes: 0
Reputation: 708
I use mysqldump to export the database. You can use something like
mysqldump -u [username] -p [database name] > backup.sql
to store it in a file. After that you can import into another database via
mysql -u [username] -p [database name] < backup.sql
Upvotes: 1