Everything is a Freaking DNS problem - mysqldump http://127.0.0.1:8080/blog/taxonomy/term/931/0 en MySQL Trigger Woes http://127.0.0.1:8080/blog/node/676 <p>After a period of inactivity I was hacking back on a Drupal project, I had taken a mysql dump from a production platform and imported into my local dev setup, just to have some realistic data.</p> <p>All of a sudden some forms started failing with the following error:</p> <p><div class="geshifilter"><pre class="text geshifilter-text" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">user warning: There is no 'user'@'nonlocalhost registered query: insert into blah (stuff,morestuff) values (x,y) in /var/vhost/drupal-tree/includes/database.mysql.inc on line 172.</div></li></ol></pre></div></p> <p>My Drupal data connection was correct and working for selects etc.. only a limited set of inserts failed.</p> <p>After some debugging I realised that the error was not Drupal related, running the same query on my MySQL console gave the same error.</p> <p><div class="geshifilter"><pre class="text geshifilter-text" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">ERROR 1449 (HY000): There is no 'user'@'nonlocalhost' registered</div></li></ol></pre></div></p> <p>The error came from a trigger on the table I was inserting data into that had been created on the production machine by a user@'host' that didn't exist on my development machine. the user was identical but the host wasn't.</p> <p>MySQLdump includes that information in a dump and uses it to restore the same values.</p> <p>So recreating the trigger on the development machine solved the problem.<br /> I should probably look a bit closer into the MySQL bugs to figure out if this is a bug or just expected behaviour.</p> <p>There might even be a parameter to disable this feature , but I didn't find it yet.</p> http://127.0.0.1:8080/blog/node/676#comments drupal mysql mysqldump trigger Fri, 13 Jun 2008 17:44:54 +0000 Kris Buytaert 676 at http://127.0.0.1:8080/blog