I have this following script which works fine on ubuntu for starting and creating a new table for MySQL database:
echo "CREATE DATABASE database_name" | mysql -u root -p
After this command is executed MySQL asks for password.
The only problem is that I want to do this on vagrant provision bash script, so I have to automate the process of entering the password. I basically have to give a single line of input to the MySQL program like this:
Enter password: password_goes_here
How do I combine the process of entering the database creation command and the password as text to the program?