# Setup for Connector/R2DBC Examples (Native API)

## Overview

The examples in this MariaDB Connector/R2DBC documentation depend on a database test and table contact.

## Create the Schema

1. Create a test database if one does not exist with the CREATE DATABASE statement:

```sql
CREATE DATABASE IF NOT EXISTS test;
```

1. Create an example table test.contact with the CREATE TABLE statement:

```sql
CREATE TABLE IF NOT EXISTS test.contact(
   id INT PRIMARY KEY AUTO_INCREMENT,
   first_name VARCHAR(25),
   last_name VARCHAR(25),
   email VARCHAR(25)) ENGINE=InnoDB;
```

## Create the User

1. Create a user account to test connectivity with the CREATE USER statement:

```sql
CREATE USER 'connr2dbc_test'@'192.0.2.50'
   IDENTIFIED BY 'db_user_password';
```

1. Ensure that the user account has privileges to access the tables with the GRANT statement:

```sql
GRANT ALL PRIVILEGES
   ON test.*
   TO 'connr2dbc_test'@'192.0.2.50';
```

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}


---

# 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://mariadb.com/docs/connectors/mariadb-connector-r2dbc/using-the-native-r2dbc-api-of-mariadb-connector-r2dbc/setup-for-connector-r2dbc-examples-native-api.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.
