Setup for Examples

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

To test the examples, connect to MariaDB Enterprise 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 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 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 GRANT statement:

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