The MySQL command works fine in MySQL itself but when I do it over my c# program, it says \"Error 0 has occurred: Fatal error encountered during command execution.\".
Is
Check that your connection string includes the following:
"Allow User Variables=True;"
This solved the problem for me.