[TriLUG] Broken MySQL Update ( MariaDB replaced it )
Alan Porter via TriLUG
trilug at trilug.org
Sun Jul 2 22:07:24 EDT 2017
> On the other hand, could I roll back and replace MariaDB with MySQL,
> or am I asking for Database Version trouble?
Step 1 - do a "mysqldump" (or Maria equivalent) [1]. That will export
your data to a plain text format.
After that, I would doubt the changes between the systems would be
significant enough that you at least could not re-import the data from
the SQL dump.
Alan
[1] I do it like this:
#!/bin/bash
directory="/root/backup/mysql"
# Do not store passwords in this script. See
<http://stackoverflow.com/questions/20751352/>
# Store them using `mysql_config_editor set --login-path=backup
--host=localhost --user=backup --password`
# and use them with `--login-path=backup`
if [ ! -d $directory ] ; then
mkdir -p $directory
fi
cd $directory
# ONE BIG FILE
mysqldump --login-path=backup --all-databases --single-transaction |
gzip > mysqldump.sql.gz
# MANY SMALL FILES
databases=$(mysql --login-path=backup --skip-column-names -e 'show
databases ;' )
for db in $databases ; do
[[ $db == 'information_schema' ]] && continue
[[ $db == 'performance_schema' ]] && continue
[[ $db == 'mysql' ]] && continue
[[ $db == 'sys' ]] && continue
mysqldump --login-path=backup --databases $db --single-transaction |
gzip > $db.sql.gz
chmod go-wrx $directory/$db.sql.gz
done
More information about the TriLUG
mailing list