我如何使用“mysql源"?带有 mysql 变量的命令? [英] How do I use "mysql source" command with a mysql variable?

查看:63
本文介绍了我如何使用“mysql源"?带有 mysql 变量的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从 mysql shell 执行一个基于类似条件的 SQL 文件mysql> 源@var其中@var 包含文件名

I need to execute from mysql shell an SQL file based on a condition like mysql> source @var where @var contains the filename

推荐答案

这是不可能的.source 是 MySQL 客户端程序在本地识别并执行的命令.变量存在于服务器上,所以客户端不知道 @variable 是什么意思.

This is not possible. source is a command that is recognized and executed locally by the MySQL client program. Variables exist on the server, so the client has no idea what @variable means.

这篇关于我如何使用“mysql源"?带有 mysql 变量的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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