Docs: Commands: init

Usage: skeema init [<options>] [<environment>]

Creates a filesystem representation of the schemas on a DB instance. For each schema on the instance (or just the single schema specified by schema), a subdir with a .skeema config file will be created. Each directory will be populated with .sql files containing CREATE statements for every table and routine in the schema.

You may optionally pass an environment name as a CLI arg. This will affect which section of .skeema config files the host-related options are written to. For example, running skeema init staging will add config directives to the [staging] section of config files. If no environment name is supplied, the default is “production”, so directives will be written to the [production] section of the file.

Init Options

OptionDescription
dirSubdir name to use for this host’s schemas
hostDatabase hostname or IP address
include-auto-incInclude starting auto-inc values in table files
portPort to use for database host
schemaOnly import the one specified schema; skip creation of subdirs for each schema
socketAbsolute path to Unix socket file used if host is localhost
strip-definerOmit DEFINER clauses when writing procs, funcs, views, and triggers to filesystem
strip-partitioningOmit PARTITION BY clause when writing partitioned tables to filesystem

Global Options

OptionDescription
connect-optionsComma-separated session options to set upon connecting to each database instance
debugEnable debug logging
helpDisplay usage information for the specified command
host-wrapperExternal bin to shell out to for host lookup; see manual for template vars
ignore-funcIgnore functions that match regex
ignore-procIgnore stored procedures that match regex
ignore-schemaIgnore schemas that match regex
ignore-tableIgnore tables or views that match regex
ignore-triggerIgnore triggers that match regex
ignore-viewIgnore views that match regex
my-cnfParse ~/.my.cnf for configuration (enabled by default; disable with skip-my-cnf)
passwordPassword for database user; omit value to prompt from TTY
server-public-key-pathFile path to server public key in PEM format; omit to obtain from server
sshTunnel MySQL connections thru SSH to this hostname or user@hostname:port
ssh-to-dbSSH to database host in order to establish database connections locally
ssl-caFile path to certificate authority in PEM format
ssl-certFile path to client-side public key in PEM format
ssl-keyFile path to client-side private key in PEM format
ssl-modeSpecify desired connection security SSL/TLS usage
ssl-verify-server-certVerify server-side cert matches server hostname
userUsername to connect to database host
versionDisplay program version