0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DBeaverで複数クエリまとめて実行するとエラーになる場合の解消法

Posted at

DBeaverを使っていて1つ1つのSQLは問題なく実行できるが複数選択してまとめて実行しようとするとエラーになる場合がある。

エラーメッセージの例
SQLエラー [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from xxxxx ...

SQLの末尾にセミコロンを付け忘れていなければ、あとはデータベースの種類によっては複数クエリの実行がデフォルトで禁止されている場合がある(MySQLなど)。

MySQLの場合の解消法

  • DBeaverのデータベースナビゲーターで対象のDB接続を右クリックして [編集 接続] を選択
  • [接続設定][ドライバのプロパティ]タブ を選択
  • プロパティの中のallowMultiQueriesの値がFalseになっているのでTrueに変更して [OK] を押す
  • 再接続するかのダイアログが表示されるので [はい] を押す
  • 再度SQLを実行してみると今度はまとめて実行ができるようになる
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?