[英]How to restore MySQL backup .sql on server
I'm using putty to connect to my MySQL server. 我正在用腻子连接到我的MySQL服务器。
I've a backup .sql file from which I want to create the tables on the server. 我有一个备份.sql文件,我想从该文件在服务器上创建表。
According to the link here restore backup mysql , I'm trying to perform this command 根据此处的链接还原备份mysql ,我正在尝试执行此命令
mysql -u username -p -h hostname databasename < dumpfile.sql
Now my question is, 现在我的问题是
dumpfile.sql
file on the server which I have uploaded. dumpfile.sql
文件的正确路径。 Say for instance I've uploaded inside www/apache/appname/
? www/apache/appname/
上传了? If you are logged on to the machine where MySQL is running, hostname
is indeed localhost (but if you leave it out, localhost is assumed). 如果您登录到运行MySQL的计算机,则
hostname
确实是localhost(但如果不使用它,则假定为localhost)。 For the path to dumpfile.sql
you can just provide the full path including all folders. 对于
dumpfile.sql
的路径,您只需提供完整路径,包括所有文件夹。 Your question shows a relative path www/apache/appname/
. 您的问题显示了相对路径
www/apache/appname/
。 I assume that you meant that to be an absolute path starting from /
. 我假设您的意思是从
/
开始的绝对路径。 If that's the case, the whole command would be 如果是这样,整个命令将是
mysql -u username -p -h localhost databasename < /www/apache/appname/dumpfile.sql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.