Fix mariadb (#539)

This commit is contained in:
Pascal Vizeli
2019-03-10 21:01:38 +01:00
committed by GitHub
parent ca3e9c4fda
commit 61480978d2
5 changed files with 17 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
# Changelog # Changelog
**Warning**: Could be that you need delete this add-on first and lost all old data. Currently we don't support database migration on update. ## 1.1
- Fix connection issue with 10.3.13
## 1.0 ## 1.0
- Update MariaDB to 10.3.13 - Update MariaDB to 10.3.13

View File

@@ -9,5 +9,6 @@ RUN apk add --no-cache mariadb mariadb-client
# Copy data # Copy data
COPY run.sh / COPY run.sh /
COPY mariadb-server.cnf /etc/my.cnf.d/
CMD [ "/run.sh" ] CMD [ "/run.sh" ]

View File

@@ -1,6 +1,6 @@
{ {
"name": "MariaDB", "name": "MariaDB",
"version": "1.0", "version": "1.1",
"slug": "mariadb", "slug": "mariadb",
"description": "An SQL database server", "description": "An SQL database server",
"url": "https://home-assistant.io/addons/mariadb/", "url": "https://home-assistant.io/addons/mariadb/",

View File

@@ -0,0 +1,10 @@
[server]
[mysqld]
datadir=/data/databases
[galera]
[mariadb]

View File

@@ -14,6 +14,9 @@ if [ ! -d "$MARIADB_DATA" ]; then
mysql_install_db --user=root --datadir="$MARIADB_DATA" > /dev/null mysql_install_db --user=root --datadir="$MARIADB_DATA" > /dev/null
else else
echo "[INFO] Use exists mariadb initial system" echo "[INFO] Use exists mariadb initial system"
mysqlcheck --no-defaults --check-upgrade --auto-repair --databases mysql --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --all-databases --fix-db-names --fix-table-names --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --check-upgrade --all-databases --auto-repair --skip-write-binlog > /dev/null || true
fi fi
# Start mariadb # Start mariadb