如何在JetBrains DataGrip中设置MySQL连接的SQL模式

5

JetBrains DataGrip是否有任何方法可以让我自动设置连接到MySQL数据库的SQL_MODE?

例如,MySQL Workbench有一个特定的字段用于设置SQL_MODE。而HeidiSQL提供了一种执行启动脚本的方法。

1个回答

11
在DataGrip中,按照以下步骤操作。
  1. Go to File > Data Sources and select your connection from the list of Project Data Source.
  2. Go to the Advanced tab which lists a lot of variables.
  3. Locate the the variable named sessionVariables. (Tip: You can search for a particular variable by selecting any variable name, then start typing to seek.)
  4. Set the value for the variable with your SQL mode. For example:

    sql_mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY'
    

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接