使用命令行还原MYSQL转储文件 [英] Restore MYSQL Dump File with Command Line

查看:174
本文介绍了使用命令行还原MYSQL转储文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有file.sql,我想恢复它.我找到了以下命令:

I have file.sql, and I want to restore it. I found this command:

mysql -u username -p database_name < file.sql

我应该在文件系统中的哪个位置放置"file.sql"?我正在使用Windows和XAMPP.谢谢.

Where should I put 'file.sql' in file system? I'm using Windows and XAMPP. Thank you.

*)转储文件为3GB ++

*) The dump file is 3GB++

推荐答案

当我执行此线程的答案时,它将返回'mysql' is not recognized as an internal or external command, operable program or batch file..

When I execute the answers of this thread, it returns 'mysql' is not recognized as an internal or external command, operable program or batch file..

原来,我必须先在xampp/mysql/bin文件夹中执行mysql.exe,转储文件路径是相对于此bin文件夹的.我把我的放在那里了,它起作用了.

Turned out that I have to execute mysql.exe first in xampp/mysql/bin folder, and the dump file path is relative to this bin folder. I put mine in there, and it worked.

谢谢.

这篇关于使用命令行还原MYSQL转储文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆