How can I import a mysql dump?

孤人 提交于 2019-12-25 06:49:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!