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?

More than 5 years have passed since last update.

Ansible 2.8に移行した時mysql_userでハマったエラー

Last updated at Posted at 2019-07-17

回避策を記載しておきます。

2.8へ移行したのが原因かの詳しい調査はしていません。

Before

--checkしたところ、パラメータを変えていないのにchangedになっていてなんでかなーと思って実行したら以下のエラー。

"msg": "(1144, 'Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used')"

playbookは以下のとおり。

- name: create user
  mysql_user:
    name: user01
    password: password01
    host: "%"
    priv: >-
      db01.*:SELECT,INSERT,UPDATE,DELETE,LOCK TABLES/
      FUNCTION db01.*:EXECUTE,ALTER ROUTINE

After

FUNCTIONを`で囲ってあげれば回避可能。

- name: create user
  mysql_user:
    name: user01
    password: password01
    host: "%"
    priv: >-
      db01.*:SELECT,INSERT,UPDATE,DELETE,LOCK TABLES/
      `FUNCTION db01`.*:EXECUTE,ALTER ROUTINE
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?