Error 1044 In MySQL: Access Denied When Using LOCK TABLES

expand
Posted in: General Programming, 2010-03-19 15:01:35
by Alexander V. Røyne-Helgesen
Tagged as:
Had some issues during a standard mysqldump. I've never encountered it before, and I've made similar dumps on identical mysql servers all day. Basically, it auto sets to lock tables somehow. It is a reported bug at MySQL, and the page states that the bug is closed. According to the forums at MySQL it seemed to be an easy fix;
GRANT SELECT,LOCK TABLES ON database.* TO 'username'@'localhost'; 
But I double checked, the user had ALL priviliges (yeah, not that safe). The same post mentioned above had a simpler solution that worked brilliantly:
mysqldump -u username -p database --single-transaction >dump.sql