# Instalar MariaDB

## Instalar MariaDB

### Buscar las imágenes

```
docker search mariadb
```

### Instalar la versión más reciente

```
docker pull mariadb:latest
```

### Ver la lista de imagenes

![](https://1214129823-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6KboeH6fWlkEGS%2F-Lc1Wj2D7osvfO8Ijk0C%2F-Lc1WvIr4kJgBCAPR9Kl%2Flista.png?generation=1554820616569440\&alt=media)

### Crear el contenedor

1. mariadbtest es el nombre del contenedor

```
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb
```

You can specify an optional major or minor version number - if you don't, the latest release will be used:

```
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb:10.1
```

```
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb:10.0.20
```

Optionally, after the image name, we can specify some[options for mysqld](https://mariadb.com/kb/en/mysqld-options/). For example:

```
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb --log-bin --binlog-format=MIXED
```

### Obtener el id del contenedor

```
docker ps
```

![](https://1214129823-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6KboeH6fWlkEGS%2F-Lc1Wj2D7osvfO8Ijk0C%2F-Lc1WvItbhnzZnInxwpK%2Fss.png?generation=1554820619292814\&alt=media)

### Ejecutar el cotenedor

* **Reiniciar el contenedor**

```
docker restart mariadbtest
```

* **Detener el Contenedor**

```
docker stop mariadbtest
```

#### Iniciar el contenedor

```
docker start mariadbtest
```

## Acceder al Contenedor

```
docker exec -it mariadbtest bash
```

![](https://1214129823-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6KboeH6fWlkEGS%2F-Lc1Wj2D7osvfO8Ijk0C%2F-Lc1WvIvUnTjfD-xJ4s3%2Fssss.png?generation=1554820619307234\&alt=media)

#### Instalar Vim

```
apt-get install vim
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/docker/chapter1/instalar-mariadb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
