问题
I have created a mysql dump for only one table in my database. The command I used to create the dump was mysqldump -uroot -p database_name table_name > backup.sql
. Now, when I am trying to import the data into my machine using the command "mysql -uroot -p database_name table_name < backup.sql
" I am not getting anything.
I only get text on command line which explains me how to use mysql command. Is there anything i am missing here?
回答1:
Remove table_name
.
mysql -uroot -p database_name < backup.sql
回答2:
Does the schema exist on your server? If you didn't used the --databases option, I don't think it adds the create database database_name
and use database_name
. You might have to execute these steps manually from the command line client.
来源:https://stackoverflow.com/questions/7390203/how-can-i-import-a-mysql-dump