Sublime Forum

Sublime build Mysql

#1

I would like to set up a mysql builder for sublime text, here is my .sublime-build file:

{ "cmd": "mysql < C:/sql/test.sql > C:/sql/result.txt"], "encoding":"cp1252", "working_dir":"C:/sql" }

This command works in the command line, but not in sublime (it throws [Error 2] The specified file was not found)

Thanks in advance!

EDIT: the command works if I add option "shell":true, but I don’t know why

0 Likes

#2

cmd accepts only an array of options, no spaces involved. So to have that working you should actually have:

"mysql", "<", "C:/sql/test.sql", ">", "C:/sql/result.txt"]

(also you may change the slashes to double backslashes like so: c:\sql…)

0 Likes