Hello,
I’d like to execute a script but my script require Mysql commands. Is it possible to use a mysql command into boot2docker??
Thank’s for your answers
Share and learn in the Docker community.
Hello,
I’d like to execute a script but my script require Mysql commands. Is it possible to use a mysql command into boot2docker??
Thank’s for your answers
Hi,
MySQL runs within your docker container and not within boot2docker. So you can use a docker exec command. In my shell script I use the following command to execute MySQL commands to create a MySQL database and import an SQL file.
docker exec -dt mycontainer sh -c ‘echo “create database mydatabase” | mysql -uroot && mysql -hlocalhost -uroot mydatabase < /var/www/html/sql/mysqlfile.sql’
I hope this helps!