Last active
October 14, 2018 13:32
-
-
Save biswajitpaul01/83ec086605cb3a223de82f9182365bdd to your computer and use it in GitHub Desktop.
Mysql Database import expost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Ref 1: https://www.tecmint.com/transfer-mysql-databases-from-old-to-new-server/ | |
### Ref 2: http://osxdaily.com/2017/01/19/export-import-all-mysql-databases/ | |
# Export all MySQL Databases to Dump File | |
> mysqldump -u [user] -p –all-databases > all_databases.sql | |
# If you want to dump a single database | |
> mysqldump -u root -p --opt [database name] > database_name.sql | |
# Transfer MySQL Databases Dump File to New Server | |
> scp all_databases.sql [email protected]:~/ [All Databases] | |
> scp database_name.sql [email protected]:~/ [Single Database] | |
# Import MySQL Databases Dump File to New Server | |
> mysql -u [user] -p –all-databases < all_databases.sql [All Databases] | |
> mysql -u [user] -p newdatabase < database_name.sql [Single Database] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment