Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading from MariaDB 10.2 to MariaDB 10.3 // docker-compose

i did an upgrade on my server for my Docker MARIADB with:

docker-compose pull
docker-compose up -d

My version before:

Server version: 10.2.14-MariaDB-10.2.14+maria~jessie mariadb.org binary distribution

SHOW VARIABLES LIKE "%version%";

+-------------------------+--------------------------------------+
| Variable_name           | Value                                |
+-------------------------+--------------------------------------+
| innodb_version          | 5.7.21                               |
| protocol_version        | 10                                   |
| slave_type_conversions  |                                      |
| version                 | 10.2.14-MariaDB-10.2.14+maria~jessie |
| version_comment         | mariadb.org binary distribution      |
| version_compile_machine | x86_64                               |
| version_compile_os      | debian-linux-gnu                     |
| version_malloc_library  | system                               |
| version_ssl_library     | OpenSSL 1.0.1t  3 May 2016           |
| wsrep_patch_version     | wsrep_25.23                          |
+-------------------------+--------------------------------------+

My version now: Server version: 10.3.9-MariaDB-1:10.3.9+maria~bionic mariadb.org binary distribution

+---------------------------------+------------------------------------------+
| Variable_name                   | Value                                    |
+---------------------------------+------------------------------------------+
| innodb_version                  | 10.3.9                                   |
| protocol_version                | 10                                       |
| slave_type_conversions          |                                          |
| system_versioning_alter_history | ERROR                                    |
| system_versioning_asof          | DEFAULT                                  |
| version                         | 10.3.9-MariaDB-1:10.3.9+maria~bionic     |
| version_comment                 | mariadb.org binary distribution          |
| version_compile_machine         | x86_64                                   |
| version_compile_os              | debian-linux-gnu                         |
| version_malloc_library          | system                                   |
| version_source_revision         | ca26f91bcaa21933147974c823852a2e1c2e2bd7 |
| version_ssl_library             | OpenSSL 1.1.0g  2 Nov 2017               |
| wsrep_patch_version             | wsrep_25.23                              |
+---------------------------------+------------------------------------------+

So it seems it was a upgrade from 10.2 to 10.3. Upgrading from MariaDB 10.2 to MariaDB 10.3

Now i get the following error in "docker-compose logs"

2018-09-28 13:03:38 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2018-09-28 13:03:38 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade

The database is working as expected. What to do to get rid of this error?

like image 376
Fritjof Avatar asked Sep 28 '18 13:09

Fritjof


People also ask

How do I connect to MariaDB in docker container?

Execute the following to connect to MariaDB using the command-line client: > docker exec -it mdb mariadb --user root -pPassword123! And that's it! That's all you need to connect to and start using (querying) MariaDB.

What is the use of Docker compose?

Docker Compose is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.


1 Answers

While I was writing the question I was able to fix it myself. If you also facing this problem:

  1. connect to the docker database container:

    docker exec -u 0 -i -t CONTAINER_NAME /bin/bash

  2. run mysql_upgrade like written in the error message:

    mysql_upgrade --user=root --password=xxyy --host=localhost

  3. I did a restart of the docker compose with:

    docker-compose stop

    docker-compose start

like image 153
Fritjof Avatar answered Sep 16 '22 22:09

Fritjof