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 3 years have passed since last update.

mysqldumpからDEFINERを削除するコマンド

Last updated at Posted at 2021-03-01

mysqldumpからDEFINERを削除するコマンド

terminal
LANG=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' < ~/hogehoge.sql > hogehoge_nodefiner.sql

そもそもDEFINERとは

Viewの操作権限を持つユーザーのこと

じゃあVIEWとは

MySQL5系から使えるようになった機能で、テーブルから取得したいデータの条件を定義してあたかも独立したテーブルのように扱えるようにしたもの。
VIEWそのものはデータを持たず、元となったテーブルからデータを参照する。
例えばテーブルの一部のカラムだけを取り出したVIEWを作成し、他のユーザーにはVIEWだけを閲覧できるように権限を設定するといった利用ができる。

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?