# Verify the Status of a MariaDB Cluster

The database will be deployed in about five minutes after the creation of your first MariaDB cluster. For more information about creating a MariaDB cluster, see [<mark style="color:blue;">Create a MariaDB Cluster</mark>](/cloud/databases/mariadb/api-howtos/create-mariadb-cluster.md).

You can manually verify whether the create request is successful because the notification mechanism is not yet available. However, you can poll the API to see when the `state` switches to `AVAILABLE`. You can use the following command:

```bash
while [[ $(curl -sXGET "https://mariadb.de-txl.ionos.com/clusters/${UUID}" -H "Authorization: Bearer ${TOKEN}" | jq -r .metadata.state) != "AVAILABLE" ]]; do
  sleep 5
  clear
  echo -e "Cluster status:\n"
  kg mariadbcluster "${UUID}" -ojsonpath='{.status.conditions}' | yq -P
  echo -e "\ncluster is not available yet, waiting 5 seconds..."
done
```

## Initialize the database and connect it to the cluster

You can connect to your MariaDB cluster soon after its creation. For example, you can connect using the `ssh` command as follows and the credentials that you set in the [<mark style="color:blue;">`POST`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">request</mark>](/cloud/databases/mariadb/api-howtos/create-mariadb-cluster.md#request):

```bash
ssh -i .ignore.id_rsa "root@${CUSTOMER_PUBLIC_IP}"
```

You can use the following command to set the environment:

```bash
DATABASE_IP="CUSTOMER_PUBLIC_IP"
read -p "DNS Name: " DNS_NAME
```

Alternatively, you can use the following commands to connect to the database:

| Description            | Command                                                        |
| ---------------------- | -------------------------------------------------------------- |
| **via the IP address** | `mysql -u username -h "${DATABASE_IP}" --password=password`    |
| **via the DNS name**   | `mysql --ssl -u username --password=password -h "${DNS_NAME}"` |

## Manage access

You can create additional users, roles, databases, and other objects via the SQL. These operations are highly dependent on your database architecture.

The `PUBLIC` role is a special role in which all database users inherit the permissions. This is also important if you want to have a user without write permissions, since by default `PUBLIC` is only allowed to write to the `public` schema.

For more information about managing databases, refer to the [<mark style="color:blue;">MariaDB Documentation</mark>](https://mariadb.com/kb/en/database-design-example-phases-4-6-testing-operation-and-maintenance/).

### Create Users

The `CREATE USER` statement can be used to create one or more user accounts in the MariaDB database. Only users with the global `CREATE USER` privilege or the `INSERT` privilege for the MySQL database can create users. For more information, refer to the [<mark style="color:blue;">MariaDB Documentation</mark>](https://mariadb.com/kb/en/create-user/).

```sql
CREATE USER user@abc IDENTIFIED BY 'password';
GRANT SELECT ON table.t2 to 'user'@'%';
```

{% hint style="success" %}
**Result:** You now have a ready-to-use MariaDB cluster.
{% endhint %}


---

# 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://docs.ionos.com/cloud/databases/mariadb/api-howtos/verify-mariadb-cluster-status.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.
