> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# mysql_* 会话设置

> ClickHouse 在 mysql_* 生成的组中的会话设置。

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置可在 [system.settings](/docs/zh/reference/system-tables/settings) 中查看，并由[源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)自动生成。

<div id="mysql_datatypes_support_level">
  ## mysql\_datatypes\_support\_level
</div>

<SettingsInfoBlock type="MySQLDataTypesSupport" default_value="decimal,datetime64,date2Date32,geometry" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "decimal,datetime64,date2Date32,geometry"},{"label": "默认将 MySQL 的具体空间类型（LINESTRING、POLYGON、MULTILINESTRING、MULTIPOLYGON）以及通用的 GEOMETRY 类型映射为对应的 ClickHouse 几何类型。通用的 GEOMETRY 列会映射到总括类型 Geometry；如果读取到某个子类型在 ClickHouse 中没有对应类型的值（MULTIPOINT、GEOMETRYCOLLECTION），会在读取时抛出异常。"}]}, {"id": "row-2","items": [{"label": "26.3"},{"label": "decimal,datetime64,date2Date32"},{"label": "默认启用现代 MySQL 类型映射。"}]}]} />

定义如何将 MySQL 类型转换为对应的 ClickHouse 类型。它是一个由逗号分隔的列表，可以是 `decimal`、`datetime64`、`date2Date32`、`date2String` 或 `geometry` 的任意组合。默认启用所有现代映射 (`decimal`、`datetime64`、`date2Date32`、`geometry`) 。

* `decimal`：在精度允许的情况下，将 `NUMERIC` 和 `DECIMAL` 类型转换为 `Decimal`。
* `datetime64`：当精度不为 `0` 时，将 `DATETIME` 和 `TIMESTAMP` 类型转换为 `DateTime64`，而不是 `DateTime`。
* `date2Date32`：将 `DATE` 转换为 `Date32`，而不是 `Date`。其优先次序高于 `date2String`。
* `date2String`：将 `DATE` 转换为 `String`，而不是 `Date`。会被 `datetime64` 覆盖。
* `geometry`：将 MySQL 的空间类型 (`LINESTRING`、`POLYGON`、`MULTILINESTRING`、`MULTIPOLYGON`) 转换为对应的 ClickHouse 几何类型，并将通用的 `GEOMETRY` 类型转换为总括类型 `Geometry`。无论是否启用此选项，`POINT` 始终都会转换为 `Point`。由于通用的 `GEOMETRY` 列可以保存任意子类型，如果读取到某个子类型在 ClickHouse 中没有对应类型的值 (`MULTIPOINT`、`GEOMETRYCOLLECTION`) ，会在读取时抛出异常；声明为 `MULTIPOINT` 或 `GEOMETRYCOLLECTION` 的列会映射为 `String`。

<div id="mysql_max_rows_to_insert">
  ## mysql\_max\_rows\_to\_insert
</div>

<SettingsInfoBlock type="UInt64" default_value="65536" />

MySQL 存储引擎进行 MySQL 批次插入时的最大行数
