Running external programs from cmd prompt

Hi,

In relation my question w.r.t. MySQL I am trying to run a mysql command in the run program transformation but it keeps running.
I have also tried to launch python in this way but it also keeps running while when executed from my cmd prompt the commands are recognized.

How should I proceed ?

Hi,

Do those programs are waiting for user input after being executed from cmd?

Hi Andrew,

I Have tested in my command prompt to connect to mysql (see my other post relating to using LOAD DATA LOCAL INFILE command). When I connect, the command prompt changes to a mysql prompt. At that moment I enter my LOAD DATA LOCAL infile command.

So what I want to do is first execute the “mysql” command in the command prompt to connect to my MySQL database and then I want to execute the LOAD DATA LOCAL INFILE command. Maybe it keeps running because internally it is not behaving like an mysql shell at that moment?

To simulate the problem I show a similar situation in which i want to execute some python commands.
Also, when I run “python” in my command prompt, it changes to a python shell.

I think the source of the problem here is that both mysql and python work in a shell mode and waits for user input. Run program action wasn’t designed for such cases.

There should be a way (some command line parameters, etc.) to make both mysql and python to execute a command and exit (or execute a script from a file and exit). If you’ll be able to execute your commands in such way from cmd, you’ll be able to run them in the similar way from EasyMorph.

By the way, I don’t think that “python import os print…” command from your screenshot will work as you expect it to.

Could you provide an example that may work ?

I’m sorry, but this question is out of the scope of EasyMorph support. Please read the help about command line parameters of mysql or just search for something like “run mysql command and exit”.

Hi Andrew,

I understand. I have looked around and I think this may work:

https://dev.mysql.com/doc/mysql-tutorial-excerpt/5.7/en/batch-mode.html

Thanks for the hint !

Kind regards,