mysql>
They lose their content at the close of the SQL connection.
mysql>
mysql> SET @varname = 3;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @varname := 3;
+---------------+
| @varname := 3 |
+---------------+
| 3 |
+---------------+
1 row in set (0.00 sec)
SELECT @varname := COUNT(*) FROM table
mysql>
mysql>