Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:server:services:mariadb [2022/06/04 00:36] – [Check/update database] added restart mariadb dan | en:server:services:mariadb [2023/02/14 21:42] (current) – [Check/update database] switched to mariadb-* instead of mysql* 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 (from the new package version) against the old still-running daemon. This will produce some error messages; however, the upgrade | + | - run mariadb-upgrade |
- | - restart the daemon, so the 10.8.3 daemon runs. | + | |
< | < | ||
- | mysql_upgrade -u root -p --skip-version-check | + | systemctl restart mariadb.service |
</ | </ | ||
< | < | ||
- | systemctl restart | + | mariadb-upgrade -u root -p |
- | </ | + | </ |
To check all tables in all databases: | To check all tables in all databases: | ||
< | < | ||
- | mysqlcheck | + | mariadb-check |
</ | </ | ||
To analyze all tables in all databases: | To analyze all tables in all databases: | ||
< | < | ||
- | mysqlcheck | + | mariadb-check |
</ | </ | ||
To repair all tables in all databases: | To repair all tables in all databases: | ||
< | < | ||
- | mysqlcheck | + | mariadb-check |
</ | </ | ||
To optimize all tables in all databases: | To optimize all tables in all databases: | ||
< | < | ||
- | mysqlcheck | + | mariadb-check |
</ | </ | ||
All " | All " | ||
< | < | ||
- | mysql_upgrade -u root -p --skip-version-check | ||
systemctl restart mariadb.service | systemctl restart mariadb.service | ||
- | mysqlcheck | + | mariadb-upgrade -u root -p |
- | mysqlcheck | + | mariadb-check |
- | mysqlcheck | + | mariadb-check |
- | mysqlcheck | + | mariadb-check |
+ | mariadb-check | ||
</ | </ |