Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
mysqldumpがこのコマンドを挿入するのを防ぐことができるかどうか疑問に思いました
/*!50017 DEFINER=`root`@`localhost`*/
または、後でsedを使用して実行する必要がある場合、たとえば
ありがとう!
この問題は2006年から発生しており、修正の兆候はありません。
ただし、ダンプファイルを書き込む前に、grep(Linuxのみ)を介してパイプを使用して定義者の行を削除しました。
mysqldump -u dbuser -p dbname | grep -v 'SQL SECURITY DEFINER' > dump.sql
少し一口(またはキーボード一杯?)ですが、それが唯一の方法だと思います。