---
name: "mdb-schema"
section: "1"
platform: "linux"
package: "mdbtools"
version: "1.0.1-0.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mdb-schema"
---

# mdb-schema(1)

Generate schema creation DDL

## NAME

**mdb-schema** - Generate schema creation DDL

## SYNOPSIS

```
mdb-schema [options] [-T tablename] [-N prefix] database [backend]
mdb-schema -h|--help
mdb-schema --version
```

## DESCRIPTION

**mdb-schema is a utility program distributed with MDB Tools.**

**It produces DDL (data definition language) output for the given** *database***. This can be passed to another** *database* **to create a replica of the original access table format.**

## OPTIONS

- **-T, --table *tablename***

  **Single table option.  Create schema for this table only. Default is to export all tables.**

- **-N, --namespace *prefix***

  **Prefix identifiers with namespace.**

- **--drop-table**

  **Issue DROP TABLE statement.**

- **--no-drop-table**

  **Don't issue DROP TABLE statement. This is the default.**

- **--not-null**

  **Issue NOT NULL constraints. This is the default.**

- **--no-not-null**

  **Don't issue NOT NULL constraints.**

- **--default-values**

  **Issue DEFAULT values.**

- **--no-default-values**

  **Don't issue DEFAULT values. This is the default.**

- **--not-empty**

  **Issue CHECK \<\> '' constraints.**

- **--no-not-empty**

  **Don't issue CHECK \<\> '' constraints. This is the default.**

- **--comments**

  **Issue COMMENT ON statements with column/table descriptions. This is the default, but it's not supported by all backends.**

- **--no-comments**

  **Don't issue COMMENT ON statements.**

- **--indexes**

  **Export INDEXes. This is the default.**

- **--no-indexes**

  **Don't export INDEXes.**

- **--relations**

  **Export foreign keys constraints. This is the default.**

- **--no-relations**

  **Don't export foreign keys constraints.**

- **--version**

  **Print the mdbtools version and exit.**

- ***backend***

  **Specifies target DDL dialect. Supported values are access, sybase, oracle, postgres, mysql and sqlite. If not specified the generated DDL will be in access format.**

## ENVIRONMENT

- **MDB\_JET3\_CHARSET**

  **Defines the charset of the input JET3 (access 97) file. Default is CP1252. See [iconv(1)](/iconv/1.md).**

- **MDBICONV**

  **Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv.**

- **MDBOPTS**

  **Colon-separated list of** *options***:**

  - •

    **debug\_like**

  - •

    **debug\_write**

  - •

    **debug\_usage**

  - •

    **debug\_ole**

  - •

    **debug\_row**

  - •

    **debug\_props**

  - •

    **debug\_all is a shortcut for all debug\_\*** *options*

  - •

    **no\_memo (deprecated; has no effect)**

  - •

    **use\_index (experimental; requires libmswstr)**

## NOTES

## HISTORY

**mdb-schema first appeared in MDB Tools 0.1.**

## SEE ALSO

**[mdb-array(1)](/mdb-array/1.md) [mdb-count(1)](/mdb-count/1.md) [mdb-export(1)](/mdb-export/1.md) [mdb-header(1)](/mdb-header/1.md) [mdb-hexdump(1)](/mdb-hexdump/1.md)** **[mdb-import(1)](/mdb-import/1.md) [mdb-json(1)](/mdb-json/1.md) [mdb-parsecsv(1)](/mdb-parsecsv/1.md) [mdb-prop(1)](/mdb-prop/1.md) [mdb-queries(1)](/mdb-queries/1.md)** **[mdb-sql(1)](/mdb-sql/1.md) [mdb-tables(1)](/mdb-tables/1.md) [mdb-ver(1)](/mdb-ver/1.md)**

## AUTHORS

**The mdb-schema utility was written by Brian Bruns and others.**

## BUGS

**Relationships and other features may not be supported by all databases.** **Access datatypes are mapped to their closest counterparts in the target** *backend***. This may not always yield an exact fit.**
