How do I use “mysql source” command with a mysql variable?

荒凉一梦 提交于 2020-06-17 02:15:28

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/1638654/how-do-i-use-mysql-source-command-with-a-mysql-variable

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