sunetdrive/templates/mariadb/mysql.erb.sh

5 lines
177 B
Bash
Raw Normal View History

2024-10-04 08:00:50 +00:00
#!/bin/bash
pw=$(yq -r '.services.db.environment[0]' /opt/mariadb/docker-compose.yml | awk -F '=' '{print $2}')
2024-10-04 08:00:50 +00:00
docker exec -ti mariadb_db_1 mysql -u root -p"${pw}" -e "${@}"