22
18

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.

AWS RDS MySQL で create function できるようにする

Last updated at Posted at 2016-03-04

Amazon Web Service の RDS 上でのデフォルトでは、root であっても CREATE FUNCTION ... すると

You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

となり、CREATE FUNCTION ができない。

エラーメッセージに書いてある通り、log_bin_trust_function_creators を設定する。

設定値の確認

mysql> SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | OFF   |
+---------------------------------+-------+

設定

RDSダッシュボードにログイン

https://ap-northeast-1.console.aws.amazon.com/rds/home?region=ap-northeast-1#parameter-groups:

log_bin_trust_function_creators で検索

スクリーンショット 2016-03-04 10.02.53.png

「<エンジンのデフォルト>」となっているので、プルダウンで 「1」に変更

「変更のプレビュー」で内容を確認

スクリーンショット 2016-03-04 9.48.07.png

問題なければ、「閉じる」→「変更の保存」

RDSのリブートは不要、即時反映される

mysql> SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | ON    |
+---------------------------------+-------+
22
18
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
22
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?