Setup for Examples

Overview

The connection example in this MariaDB Connector/ODBC documentation depends on a database test and table contacts.

To test the examples, connect to MariaDB database products using MariaDB Client, and create the database objects shown below.

Create the Schema

The example ODBC configurations connect to the test database.

Create the test database if it does not already exist using the CREATE DATABASECREATE DATABASE statement:

CREATE DATABASE IF NOT EXISTS test;

Create the User

The example ODBC configurations connect to the test database as the db_user user account.

Create the db_user user account using the CREATE USERCREATE USER statement:

CREATE USER 'db_user'@'localhost'
   IDENTIFIED BY 'db_user_password';

And ensure that the db_user account has sufficient privileges on the test database using the GRANTGRANT statement:

GRANT ALL PRIVILEGES ON test.*
   TO 'db_user'@'localhost';