Did you try that SQL statement outside your script? I mean, manually, from the mysql monitor?