-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove stopper service from automation script
- Loading branch information
Showing
6 changed files
with
27 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dump-data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
examples/migration-8.0/dump-data/mysql-dump-data-utf8mb4_unicode_ci.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
#!/bin/bash | ||
|
||
echo 'MariaDB service started. Dump MySQL data ...' | ||
echo 'MariaDB service started.' | ||
# Run your commands and exit container | ||
whoami # mysql" | ||
whoami # mysql | ||
# sh -c "chown -R mysql:mysql /etc/dump" # Operation permitted | ||
# sh -c "ls -la /etc/dump" | ||
sh -c "mariadb-dump -h mysql-container -uroot -psecret testdb > /etc/dump/mysql-dump-data.sql" | ||
sh -c "ls -la /etc/dump/" | ||
echo "List before" | ||
sh -c "cp /etc/dump/mysql-dump-data.sql /etc/dump/mysql-dump-data-utf8mb4_unicode_ci.sql" | ||
sh -c "ls -la /etc/dump/" | ||
echo "List after" | ||
sh -c "sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' /etc/dump/mysql-dump-data-utf8mb4_unicode_ci.sql" | ||
echo 'Dump and compress MySQL data with changed collation ...' | ||
fileName="mysql-dump-data.sql.zst" | ||
if [ -f "$fileName" ]; then | ||
echo "File ${fileName} exists. Remove it ... " | ||
rm "$fileName" | ||
fi | ||
sh -c "mariadb-dump -h${MYSQL_CONT_NAME} -uroot -p${MARIADB_ROOT_PASSWORD} ${MARIADB_DB} | sed 's/utf8mb4_0900/uca1400/g' | zstd > /etc/dump/${fileName}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
#!/bin/bash | ||
echo "Extract file" | ||
oldFile="/etc/dump/mysql-dump.sql" | ||
if [ -f "$oldFile" ]; then | ||
echo "Old file ${oldFile} exists. Remove it ... " | ||
rm "$oldFile" | ||
echo "Extracting ..." | ||
fi | ||
sh -c "zstd -d /etc/dump/mysql-dump-data.sql.zst -o /etc/dump/mysql-dump.sql" | ||
echo "Show data in MariaDB" | ||
mariadb -uroot -psecret -e "create database testdb;" | ||
mariadb -uroot -psecret testdb < /etc/dump/mysql-dump-data-utf8mb4_unicode_ci.sql | ||
mariadb -uroot -psecret -e "show databases; select * from countries;" | ||
mariadb -uroot -p"${MARIADB_ROOT_PASSWORD}" -e "create database testdb;" | ||
mariadb -uroot -p"${MARIADB_ROOT_PASSWORD}" "${MARIADB_DB}" < /etc/dump/mysql-dump.sql | ||
mariadb -uroot -p"${MARIADB_ROOT_PASSWORD}" -e "show databases; select * from testdb.countries;" |