LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

doctl-databases-sql-mode

manage MySQL SQL mode settings

TLDR

Get current SQL mode for a database cluster
$ doctl databases sql-mode get [cluster_id]
copy
Set SQL mode for a database cluster
$ doctl databases sql-mode set [cluster_id] [ANSI_QUOTES] [STRICT_TRANS_TABLES]
copy
Set SQL mode with output format
$ doctl databases sql-mode get [cluster_id] --format [SQLMode]
copy

SYNOPSIS

doctl databases sql-mode command [options]

DESCRIPTION

doctl databases sql-mode manages SQL mode settings for MySQL managed database clusters on DigitalOcean. SQL modes control how MySQL handles query syntax validation, data type conversions, and error conditions.Common SQL modes include STRICTTRANSTABLES (reject invalid data), ANSIQUOTES (treat double quotes as identifier quotes), NOZERODATE (disallow '0000-00-00' dates), and ONLYFULLGROUPBY (require GROUP BY to include all non-aggregated columns).Setting SQL modes replaces the existing configuration entirely rather than appending to it. To add a mode, first retrieve the current modes with get, then include them all in the set command.

PARAMETERS

--format columns

Columns for output in a comma-separated list.
--no-header
Return raw data with no headers.

SUBCOMMANDS

get

Get current SQL mode for a MySQL database cluster.
set
Set SQL mode for a MySQL database cluster. Provide one or more modes as space-separated arguments.

SEE ALSO

Copied to clipboard
Kai