← 返回命令列表

Linux command

doctl-databases-sql-mode 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Get current SQL mode

doctl databases sql-mode get [cluster_id]

Set SQL mode

doctl databases sql-mode set [cluster_id] [ANSI_QUOTES] [STRICT_TRANS_TABLES]

Set SQL mode with output format

doctl databases sql-mode get [cluster_id] --format [SQLMode]

说明

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 STRICT_TRANS_TABLES (reject invalid data), ANSI_QUOTES (treat double quotes as identifier quotes), NO_ZERO_DATE (disallow '0000-00-00' dates), and ONLY_FULL_GROUP_BY (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.

参数

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

FAQ

What is the doctl-databases-sql-mode command used for?

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 STRICT_TRANS_TABLES (reject invalid data), ANSI_QUOTES (treat double quotes as identifier quotes), NO_ZERO_DATE (disallow '0000-00-00' dates), and ONLY_FULL_GROUP_BY (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.

How do I run a basic doctl-databases-sql-mode example?

Run `doctl databases sql-mode get [cluster_id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --format _columns_ do in doctl-databases-sql-mode?

Columns for output in a comma-separated list.