Create a database

Goal-oriented guide to creating and selecting databases.

Version
Latest
v0.1.0 · latest 1 min read
On this page
  1. Steps
  2. Explanation

Goal: create an isolated database and start using it. Prerequisites: server running (Quickstart).

Steps#

  1. Create it
    sqlsource
    CREATE DATABASE shop;
  2. Use it
    sqlsource
    USE shop;
    -- or reconnect with database=shop
  3. Verify
    sqlsource
    SHOW databases;
    SELECT current_database();

Expected result: SHOW databases lists plomid and shop; current_database() returns shop.

Explanation#

plomid shares the root engine; shop gets <data_dir>/databases/shop/ with its own WAL. Names must match [_A-Za-z][_A-Za-z0-9]*.

Next: Create a table · Related: Configuration

Was this page helpful?