How to access mysql inside the mattermost container

Good morning

I’m running mattermost on UCS 4.4.9.x. I would like to upgrade UCS to version 5 - but need to get mattermost first migrated to a different system.

For the migration I need access to the mattermost database (mysql). Mattermost is a container app with mysql inside as well.

I found out what the name of the container is and found some command to access mysql - but I’m getting an access denied.

docker exec -it eager_elbakyan mysql -u root -p

Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

I belive I have never created one or changed the default configuration.

Anyone who know how to get acess?

Perfect would be - If I could use my MySQL Workbench tool to access the database. So if you know how to make this possible, that would be perfect.

PS: The daily DUMP is not good enoth for tje migration to a up-to-date mattermost version - so I need the access to the database direct.

Thank you in advanvce

Pepe

Hi Pepe,

some time ago when we still used MM, we did backup with the following

univention-app shell mattermost mysqldump --user=mmuser --password=THISISMYMMDBPASSWORD --databases mattermost > FILENAME.sql

In addition to the MySQL database the folders config and files should be backed up as well.

/var/lib/univention-appcenter/apps/mattermost/data/config
/var/lib/univention-appcenter/apps/mattermost/data/files

If you get an error like this
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
you can try adding --no-tablespaces as option to mysqldump

Good luck!