使用命令行执行.sql文件 [英] execute .sql file using command line

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

问题描述

我正在尝试在命令行中运行/desktop/folder/query.sql中的sql文件. 我已将数据库更改为所需的数据库,但不确定如何执行该文件.预先感谢您的帮助

I am trying to run a sql file located at /desktop/folder/query.sql in command line. I have the database changed to the one that I need but am unsure how to execute the file. Thanks in advance for any help

推荐答案

回答我自己的问题

mysql> source desktop/folder/query.sql;

只需要使用'source'前缀即可.

Just had to use the 'source' prefix.

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

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