Last active
August 29, 2015 14:09
-
-
Save fraank/a8a9db589f56379db027 to your computer and use it in GitHub Desktop.
mysql console
This file contains 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
# Export one table from database: | |
mysqldump -u root -p db_with_data table1 > /your/path/newsql.sql | |
# .. and import it again to another db: | |
mysql -u username -p -D db_without_data < /your/path/newsql.sql | |
if you need some encoding you can add "--default-character-set=UTF8" | |
#You can also connect directly into mysql and set the source: | |
mysql –h <host_name> -port=3306 –u <db_master_user> -p | |
mysql> source backup.sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment