Skip to content

Commit

Permalink
Updated mariadb/content.md, clean markdownfmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeamHall committed Oct 27, 2021
1 parent 4503403 commit 3a80d65
Showing 1 changed file with 7 additions and 31 deletions.
38 changes: 7 additions & 31 deletions mariadb/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,10 @@ or:

```console
$ docker network create some-network
$docker run --detach --network some-network --name some-%%REPO%% --env MARIADB_USER=example-user --env MARIADB_PASSWORD=my_cool_secret --env MARIADB_ROOT_PASSWORD=my-secret-pw %%IMAGE%%:latest
$ docker run --detach --network some-network --name some-%%REPO%% --env MARIADB_USER=example-user --env MARIADB_PASSWORD=my_cool_secret --env MARIADB_ROOT_PASSWORD=my-secret-pw %%IMAGE%%:latest
```
... where `some-network` is a newly created network (other than `bridge` as the default network), `some-%%REPO%%` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MariaDB root user. See the list above for relevant tags to match your needs and environment.

You can get information on your container with Docker commands. For example, to get the container ID of your new instance:


```console
$ docker ps
```

To get the IP address of your server instance, use the container ID given above:

```console
$ docker inspect <server container ID> |grep IPAddress
```

... where `some-network` is a newly created network (other than `bridge` as the default network), `some-%%REPO%%` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MariaDB root user. See the list above for relevant tags to match your needs and environment.

## Connect to MariaDB from the MySQL/MariaDB command line client

Expand All @@ -53,25 +40,14 @@ This image can also be used as a client for non-Docker or remote instances:
```console
$ docker run -it --rm %%IMAGE%% mysql -h <server container IP> -u example-user -p
```
That will give you a standard MariaDB prompt. You can test it with:

```console
MariaDB [(none)]> SELECT VERSION();
```

... which should give you the version. You can then use `exit` to leave the MariaDB command line client and the client container.
That will give you a standard MariaDB prompt. You can test it with:

## Docker Cleanup

Docker cleanup is easy; get the container IDs from `docker ps`, stop any containers that are still running, and then remove the container and network by name.

$ docker ps
$ docker stop <server container ID>
$ docker stop <client container ID>
$ docker rm some-%%REPO%%
$ docker rm some-%%REPO%%-client
$ docker network rm some-network
```console
MariaDB [(none)]> SELECT VERSION();
```

... which should give you the version. You can then use `exit` to leave the MariaDB command line client and the client container.

More information about the MariaDB command-line client can be found in the [MariaDB Knowledge Base](https://mariadb.com/kb/en/mysql-command-line-client/)

Expand Down

0 comments on commit 3a80d65

Please sign in to comment.