mysql>SET syntax uses = rather than := to assign the value:mysql>mysql>mysql> SET @sum = 4 + 7;Query OK, 0 rows affected (0.00 sec)mysql> SELECT @sum;+------+| @sum |+------+| 11 |+------+1 row in set (0.00 sec)mysql>mysql>