Skip to content

Commit

Permalink
Remove M!999999 from first line in sql export if the line is there
Browse files Browse the repository at this point in the history
  • Loading branch information
JeGoi committed Jan 28, 2025
1 parent 628c1be commit 18785d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/functions/database.functions
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function import_mysqldump() {
exit 1
fi

if egrep "M!999999" $dump_file > /dev/null; then
sub_splitter
echo 'Removing /*M!999999\- enable the sandbox mode */ in the dump db file'
sed -i '1d' $dump_file
fi

mariadb_args="--defaults-file=`pwd`/setup_mycnf --socket=/var/lib/mysql/mysql.sock"
# we need a grant dump generated via: mysql ${MYSQL_CONN} --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql ${MYSQL_CONN} --skip-column-names -A | sed 's/$/;/g' > grants.sql
if ! test_db_connection_no_creds; then
Expand Down

0 comments on commit 18785d7

Please sign in to comment.