* Sun Apr 20 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-14.sme
- set innodb_page_size=64k [SME: 12982] breaking change, needs backup and restore of mariadb databases - convert mysql* bins call to mariadb-* [SME: 12983] - revert [SME: 12591]
This commit is contained in:
@@ -18,12 +18,12 @@ onfailure () {
|
||||
echo $message | /usr/bin/mail -s "error on backup of $db MariaDB database" admin
|
||||
fi
|
||||
message="$message \nThere was an error trying to dump database $db, please check for table errors in this db. Forcing a backup of the corrupted DB."
|
||||
mysqldump --force --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db"-failed.dump || message="$message \nFailed to force backup of corrupted db $db as $db-failed.dump" >&2
|
||||
mariadb-dump --force --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db"-failed.dump || message="$message \nFailed to force backup of corrupted db $db as $db-failed.dump" >&2
|
||||
if [ "$fixtables" = "enabled" ]; then
|
||||
repair="failure"
|
||||
message="$message \nTrying to auto-repair the db and do a backup after..."
|
||||
mysqlcheck -s --auto-repair -c "$db" && \
|
||||
mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump && repair="success"
|
||||
mariadb-check -s --auto-repair -c "$db" && \
|
||||
mariadb-dump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump && repair="success"
|
||||
message="$message \n => $repair"
|
||||
fi
|
||||
echo $message
|
||||
@@ -37,17 +37,18 @@ then
|
||||
fi
|
||||
for db in $(mysql -BNre "show databases;"|egrep -vi "^information_schema$|^performance_schema$")
|
||||
do
|
||||
mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump || onfailure $db
|
||||
mariadb-dump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump || onfailure $db
|
||||
done
|
||||
# double usage as already in mysql.dump
|
||||
# dump user privileges
|
||||
mysqldump --system=users --insert-ignore > /home/e-smith/db/mysql/mysql.privileges.dump
|
||||
#mariadb-dump --system=users --insert-ignore > /home/e-smith/db/mysql/mysql.privileges.dump
|
||||
# dump plugins
|
||||
mysqldump --system=plugins --insert-ignore > /home/e-smith/db/mysql/mysql.plugins.dump
|
||||
#mariadb-dump --system=plugins --insert-ignore > /home/e-smith/db/mysql/mysql.plugins.dump
|
||||
# dump udfs
|
||||
mysqldump --system=udfs --insert-ignore > /home/e-smith/db/mysql/mysql.udfs.dump
|
||||
#mariadb-dump --system=udfs --insert-ignore > /home/e-smith/db/mysql/mysql.udfs.dump
|
||||
# dump servers
|
||||
mysqldump --system=servers --insert-ignore > /home/e-smith/db/mysql/mysql.servers.dump
|
||||
#mariadb-dump --system=servers --insert-ignore > /home/e-smith/db/mysql/mysql.servers.dump
|
||||
# dump stats
|
||||
mysqldump --system=stats --insert-ignore > /home/e-smith/db/mysql/mysql.stats.dump
|
||||
#mariadb-dump --system=stats --insert-ignore > /home/e-smith/db/mysql/mysql.stats.dump
|
||||
# dump timezones
|
||||
mysqldump --system=timezones --insert-ignore > /home/e-smith/db/mysql/mysql.timezones.dump
|
||||
#mariadb-dump --system=timezones --insert-ignore > /home/e-smith/db/mysql/mysql.timezones.dump
|
||||
|
@@ -5,8 +5,8 @@
|
||||
# non RH ocmpiled version of mariadb limits MyISAM index to 1000 bytes, newer mysql db use Aria as engine for those tables
|
||||
( /usr/bin/mysql_filter_user_table /home/e-smith/db/mysql/mysql.dump |sed -e 's/ENGINE=MyISAM/ENGINE=Aria/';
|
||||
[ -f /home/e-smith/db/mysql/mysql.privileges.dump ] && cat /home/e-smith/db/mysql/mysql.privileges.dump;
|
||||
cat /var/lib/mysql.private/set.password ) | mysql || exit 1
|
||||
/usr/bin/mysql_upgrade
|
||||
cat /var/lib/mysql.private/set.password ) | mariadb || exit 1
|
||||
/usr/bin/mariadb-upgrade
|
||||
/bin/rm /run/mariadb/mariadb.pid
|
||||
/usr/bin/systemctl restart mariadb.service
|
||||
for i in $(seq 1 20);
|
||||
@@ -17,8 +17,8 @@ do
|
||||
[ -f /home/e-smith/db/mysql/mysql.privileges.dump ] /bin/rm /home/e-smith/db/mysql/mysql.privileges.dump
|
||||
exit 0
|
||||
fi
|
||||
echo waiting for mysqld to restart
|
||||
echo waiting for mariadb to restart
|
||||
sleep 1
|
||||
done
|
||||
echo mysqld failed to restart
|
||||
echo mariadb failed to restart
|
||||
exit 1
|
||||
|
@@ -2,4 +2,9 @@
|
||||
#innodb
|
||||
{# enabled is already the default
|
||||
}innodb_file_per_table={ $mariadb{'innodb_file_per_table'}||'1' }
|
||||
# innodb_strict_mode = 0
|
||||
# higher size see SME 12982
|
||||
innodb_page_size=64k
|
||||
innodb_log_buffer_size={ $mariadb{'innodb_log_buffer_size='}||'32M' }
|
||||
innodb_buffer_pool_size={ $mariadb{'innodb_buffer_pool_size'}||'512M' }
|
||||
|
||||
|
Reference in New Issue
Block a user