Posted On December 20, 2019

Linux: MySql Docker Container – Export database

kimconnect 0 comments
blog.KimConnect.com >> Codes , Linux >> Linux: MySql Docker Container – Export database
# Set Variables
sqlContainer="mysql-server"
userName=brucelee
password=chucknorris
databaseName=kimconnect


# Run mysql inside container
docker exec -it  $sqlContainer mysql -u$userName --password='$password'
show databases;

# Execute mysqldump
docker exec $sqlContainer /usr/bin/mysqldump -u$userName --password='$password' $databaseName | gzip > /var/tmp/$databaseName.sql.gz

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Obtain List of Hyper-V Hosts in All Domains of All Forests

Version 0.03: https://blog.kimconnect.com/powershell-obtain-list-of-hyper-v-hosts-via-active-directory/ Version 0.02: https://blog.kimconnect.com/powershell-get-nic-mtus-of-all-hyper-v-hosts-in-domain-forest/ Previous version: # listHyperVHostsInForests.ps1# version 0.01# This function scans…

PowerShell: Notify Each User Before Password Expires

# This script email users basing on their password expiration dates # User input variables…

Reset Internet Explorer Settings Script

You can reset Internet Explorer settings to return them to the state they were in when…