Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
en:server:services:mariadb [2022/05/30 09:28] – [Backup database] added crontab and changed the script info dan | en:server:services:mariadb [2023/01/01 01:01] – [Backup database] changed dump all database comand and added single dump database command dan | ||
---|---|---|---|
Line 101: | Line 101: | ||
===== Backup database ===== | ===== Backup database ===== | ||
- | You can dump all databases with the following command '' | + | You can dump all databases with the following command '' |
- | '' | + | |
Or use the following script, which contains: | Or use the following script, which contains: | ||
Line 186: | Line 185: | ||
Upon a major version release of mariadb (for example mariadb-10.7.4-1 to mariadb-10.8.3-1), | Upon a major version release of mariadb (for example mariadb-10.7.4-1 to mariadb-10.8.3-1), | ||
- | - keep the 10.7.4-1 database daemon running | + | - upgrade |
- | - upgrade | + | - restart |
- | - run mysql_upgrade | + | - run mysql_upgrade |
- | | + | |
+ | < | ||
+ | systemctl | ||
+ | </ | ||
< | < | ||
mysql_upgrade -u root -p | mysql_upgrade -u root -p | ||
- | </ | + | </ |
To check all tables in all databases: | To check all tables in all databases: | ||
Line 204: | Line 206: | ||
mysqlcheck --all-databases -u root -p -a | mysqlcheck --all-databases -u root -p -a | ||
</ | </ | ||
+ | |||
To repair all tables in all databases: | To repair all tables in all databases: | ||
- | `mysqlcheck --all-databases -u root -p -r` | + | < |
- | + | mysqlcheck --all-databases -u root -p -r | |
+ | </ | ||
+ | |||
To optimize all tables in all databases: | To optimize all tables in all databases: | ||
- | `mysqlcheck --all-databases -u root -p -o` | + | < |
+ | mysqlcheck --all-databases -u root -p -o | ||
+ | </ | ||
+ | |||
+ | All " | ||
+ | < | ||
+ | systemctl restart mariadb.service | ||
+ | mysql_upgrade -u root -p | ||
+ | mysqlcheck --all-databases -u root -p -c | ||
+ | mysqlcheck --all-databases -u root -p -a | ||
+ | mysqlcheck --all-databases -u root -p -r | ||
+ | mysqlcheck --all-databases -u root -p -o | ||
+ | </ |