Skip to content

Commit d06c6c2

Browse files
authored
Merge pull request #124 from linuxserver/check-repair
Add Check and Repair documentation
2 parents dcc47ba + bcc4912 commit d06c6c2

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

README.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ Find custom.cnf in /config for config changes (restart container for them to tak
7777

7878
The `MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD REMOTE_SQL` env values can be set in a file:
7979

80-
```
80+
```path
8181
/config/env
8282
```
8383

8484
Using the following format:
8585

86-
```
86+
```env
8787
MYSQL_ROOT_PASSWORD="ROOT_ACCESS_PASSWORD"
8888
MYSQL_DATABASE="USER_DB_NAME"
8989
MYSQL_USER="MYSQL_USER"
@@ -97,16 +97,29 @@ These settings can be mixed and matched with Docker ENV settings as you require,
9797

9898
We support a one time run of custom sql files on init. In order to use this place `*.sql` files in:
9999

100-
```
100+
```path
101101
/config/initdb.d/
102102
```
103103
This will have the same effect as setting the `REMOTE_SQL` environment variable. The sql will only be run on the containers first boot and setup.
104104

105-
### Upgrading
105+
### Check and Repair
106106

107-
When this container initializes, if `MYSQL_ROOT_PASSWORD` is set an upgrade check will run. If an upgrade is required the log will indicate the need to run:
107+
If user databases are not in a healthy state (sometimes caused by a failed upgrade), it may be remedied by running:
108108

109+
```shell
110+
mariadb-check -u root -p<PASSWORD> -c -A # check all databases for errors
111+
mariadb-check -u root -p<PASSWORD> -r -A # repair all databases
112+
mariadb-check -u root -p<PASSWORD> -a -A # analyze all databases
113+
mariadb-check -u root -p<PASSWORD> -o -A # optimize all databases
109114
```
115+
116+
After running the above commands, you may need to run the upgrade command again.
117+
118+
### Upgrading
119+
120+
When this container initializes, if `MYSQL_ROOT_PASSWORD` is set an upgrade check will run. If an upgrade is required the log will indicate the need stop any services that are accessing databases in this container, and then run the command:
121+
122+
```shell
110123
mariadb-upgrade -u root -p<PASSWORD>
111124
```
112125

readme-vars.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ app_setup_block: |
6868
6969
The `MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD REMOTE_SQL` env values can be set in a file:
7070
71-
```
71+
```path
7272
/config/env
7373
```
7474
7575
Using the following format:
7676
77-
```
77+
```env
7878
MYSQL_ROOT_PASSWORD="ROOT_ACCESS_PASSWORD"
7979
MYSQL_DATABASE="USER_DB_NAME"
8080
MYSQL_USER="MYSQL_USER"
@@ -88,16 +88,29 @@ app_setup_block: |
8888
8989
We support a one time run of custom sql files on init. In order to use this place `*.sql` files in:
9090
91-
```
91+
```path
9292
/config/initdb.d/
9393
```
9494
This will have the same effect as setting the `REMOTE_SQL` environment variable. The sql will only be run on the containers first boot and setup.
9595
96-
### Upgrading
96+
### Check and Repair
9797
98-
When this container initializes, if `MYSQL_ROOT_PASSWORD` is set an upgrade check will run. If an upgrade is required the log will indicate the need to run:
98+
If user databases are not in a healthy state (sometimes caused by a failed upgrade), it may be remedied by running:
9999
100+
```shell
101+
mariadb-check -u root -p<PASSWORD> -c -A # check all databases for errors
102+
mariadb-check -u root -p<PASSWORD> -r -A # repair all databases
103+
mariadb-check -u root -p<PASSWORD> -a -A # analyze all databases
104+
mariadb-check -u root -p<PASSWORD> -o -A # optimize all databases
100105
```
106+
107+
After running the above commands, you may need to run the upgrade command again.
108+
109+
### Upgrading
110+
111+
When this container initializes, if `MYSQL_ROOT_PASSWORD` is set an upgrade check will run. If an upgrade is required the log will indicate the need stop any services that are accessing databases in this container, and then run the command:
112+
113+
```shell
101114
mariadb-upgrade -u root -p<PASSWORD>
102115
```
103116

0 commit comments

Comments
 (0)