{"categories":["MySQL"],"provider_name":"Hatena Blog","description":"qiita.com \u3042\u3093\u307e\u308atruncate table\u3059\u308b\u6a5f\u4f1a\u304c\u3044\u307e\u307e\u3067\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001mysql\u3067truncate\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u5916\u90e8\u30ad\u30fc\u306e\u5236\u7d04\u304c\u3042\u308b\u304b\u3089\u3067\u304d\u307e\u305b\u3093\u3063\u3066\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u304d\u305f\u3068\u304d\u3001\u3069\u3046\u3057\u3066\u3082truncate\u3057\u305f\u3044\u5834\u5408\u306f\u6b21\u306e\u69d8\u306b\u5916\u90e8\u30ad\u30fc\u30c1\u30a7\u30c3\u30af\u3092\u4e00\u5ea6\u30ad\u30eb\u30c8\u3044\u3044\u3088\u3046\u3067\u3059\u3002 mysql> truncate table messages; ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (`database_name`.`table_name`, CONSTRAINT \u2026","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fuchinoinu.hatenablog.jp%2Fentry%2F2017%2F10%2F18%2F232425\" title=\" &quot;Cannot truncate a table referenced in a foreign key constraint&quot; \u5916\u90e8\u30ad\u30fc\u5236\u7d04\u3067truncate table\u3067\u304d\u306a\u304b\u3063\u305f\u6642\u306e\u5bfe\u5fdc - \u3046\u3061\u306e\u3044\u306c Tech Blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","type":"rich","blog_title":"\u3046\u3061\u306e\u3044\u306c Tech Blog","author_name":"susanne","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/susanne/","published":"2017-10-18 23:24:25","blog_url":"https://uchinoinu.hatenablog.jp/","title":" \"Cannot truncate a table referenced in a foreign key constraint\" \u5916\u90e8\u30ad\u30fc\u5236\u7d04\u3067truncate table\u3067\u304d\u306a\u304b\u3063\u305f\u6642\u306e\u5bfe\u5fdc","version":"1.0","height":"190","url":"https://uchinoinu.hatenablog.jp/entry/2017/10/18/232425"}