[SOLVED] How can I connect to Mattermost database?

I would like to inspect the tables etc. I intend to use JetBrains DataGrip.

Please give me instructions on how I can connect.

"SqlSettings": {
    "DriverName": "mysql",
    "DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8",
    "DataSourceReplicas": [],
    "MaxIdleConns": 10,
    "MaxOpenConns": 10,
    "Trace": false,
    "AtRestEncryptKey": "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QVg"
},

OK, so I’ve resolved this. For those interested the solution is:

Make sure docker containers are running:

~ : $ docker ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                                        NAMES
170eadcf370c        osixia/openldap:1.1.2   "/container/tool/run"    2 weeks ago         Up 13 seconds       0.0.0.0:389->389/tcp, 0.0.0.0:636->636/tcp   mattermost-openldap
4d27bf0560e4        postgres:9.4            "/docker-entrypoint.s"   2 weeks ago         Up 13 seconds       0.0.0.0:5432->5432/tcp                       mattermost-postgres
3cafbb96c864        mysql:5.7               "docker-entrypoint.sh"   2 weeks ago         Up 13 seconds       0.0.0.0:3306->3306/tcp                       mattermost-mysql

Then run

docker exec -ti mattermost-mysql /bin/bash

Login to mysql using username and password;

root@3cafbb96c864:/# mysql -u root -p
Enter password: mostest

If you’d like to use an SQL IDE like DataGrip you can make a connection with the following info:

Host:dockerhost
User:mmuser
password:mostest 

Or you can just connect using the URL jdbc:mysql://dockerhost:3306

Now Mattermost is runing. But I want to query and study relative database with mattermost .I use Cento7 Linux .What should I continue?Please see attachment image file.. The screen shot is the image of t
this pc with putty.

Hello, @soethet (and everyone else running mattermost-preview through Docker).

You should be able to access the SQL database through the following commands. For example:
57

Let me know how it goes. Thanks.