0

I'm editing a deployment script that should execute some commands inside my database container.

This script must execute a command which performs a connection to databse inside the container followed by creating a databse.

Once the connection is done the seconde command is not executed.

docker exec -it db bash -c "mysql -u admin -pPassword && CREATE DATABASE test;"

So how can I perform the two commands in the same time.

1 Answer 1

1

For any one who try to find a solution here is it

docker exec -it db bash -c "mysql -u admin -pxxxx -e'CREATE DATABASE test'"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.