Are you using freestyle jobs or pipeline?

With Pipeline:

When you use a bat/sh step you’re providing a batch or shell script rather than 
virtual input into a console.

In your case you’d need to do something like:
bat """
cd c:\...
...\mysql --user %user% --password %password% -e "DROP DATABASE xyz; CREATE 
DATABASE xyz;"
"""

Freestyle you’d use the same text between the triple quotes in a Batch step.

Regards,
Daniel.

From: harvey
Sent: 04 September 2017 12:04
To: Jenkins Users
Subject: Multiple commands

Hi,

I am a new user to Jenkins. I just started working with Jenkins. I am learning 
to automate using Jenkins. But I dont find like how to pass two commands? For 
example, if I need to run a database creation using MySQL I should do the 
following:

cd c:\...\MySQL 5.5 server\bin\mysql.exe
password: ********
drop database xyz;
create database xyz;

Actually there is a wait between the execution of the commands, so how do i do 
it? Please if someone could help ?

Regards,
Harvey
-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/59ad3c49.cd801c0a.9d55c.2834%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to