1

I want to call an OS level commands from mysql prompt within Windows command line tool.

In Unix* there is a system command available to execute OS commands within MySQL prompt.

Any way of dong the same in windows or even in workbench as well?

The objective is to invoke a OS command within a mysql prompt.

RolandoMySQLDBA
185k34 gold badges327 silver badges541 bronze badges
asked Dec 15, 2014 at 11:04
1
  • The posted answer (dba.stackexchange.com/a/86271/877) is the only plausible answer. Otherwise, the only workaround is ot get the source code for the mysql client and mysql workbench and inject system code into it. Commented Dec 16, 2014 at 16:40

1 Answer 1

1

(削除) You cannot run OS commands in a MySQL CLI nor in MySQL Workbench. Why would you do that (except for trying to hack a machine via an SQL connection)? (削除ここまで) If you need to run an OS command, open a normal shell window (that still stands).

Update: The system command only works on Unix like OSes (http://dev.mysql.com/doc/refman/5.6/en/mysql-commands.html), e.g. Linux + Mac.

MySQL Workbench doesn't support most of these CLI commands however (use and delimiter are 2 that are supported).

answered Dec 16, 2014 at 8:31
7
  • what could i do if i need to call a OS command within procedure execution.. Commented Dec 16, 2014 at 8:51
  • You simply can't. It's not allowed, certainly for security reasons. Commented Dec 16, 2014 at 11:32
  • if so then why it is allowed in UNIX* OS?.. Commented Dec 16, 2014 at 11:33
  • 1
    I think with "that stands still" you actually mean "that still stands". "That stands still" means "it's not moving"... Commented Dec 16, 2014 at 15:03
  • any workaround to achieve the goal @a_horse_with_no_name ? Commented Dec 16, 2014 at 15:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.