connection 1

1
2
3
4
5
6
7
8
9
10
11
12
13
mysql> create temporary table tmp_foo select * from users;
Query OK, 2 rows affected (0.08 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select * from tmp_foo;
+---------+----------+---------------------+
| user_id | username | created_date        |
+---------+----------+---------------------+
|       1 | f00      | 2011-03-14 12:39:38 |
|       2 | bar      | 2011-03-14 12:39:38 |
+---------+----------+---------------------+
2 rows in set (0.00 sec)

connection 2

1
2
3
4
5
6
mysql> select * from tmp_foo;
ERROR 1146 (42S02): Table 'foo_db.tmp_foo' doesn't exist
mysql> drop table tmp_foo;
ERROR 1051 (42S02): Unknown table 'tmp_foo'
mysql>