1
我将我的应用程序从一台MySQL服务器扩展到3节点MySQL Galera Gluster。偶然临时表不会被复制。如何在Galera集群中使用MySQL临时表?
有没有一个常见的解决方法这个问题?
我当前的代码如下所示:
$stmt = "
CREATE TEMPORARY TABLE tmp (`city_id` MEDIUMINT(8) UNSIGNED NOT NULL ,INDEX (`city_id`))
";
db_query($stmt);
# travel tips
$stmt = "
INSERT INTO tmp
SELECT city_id
FROM $DB.$T33 g
WHERE g.country_code = '$country[code]'
GROUP BY city_id
";
execute_stmt($stmt, $link);
的错误信息是:
Error: 1146 Table 'test.tmp' doesn't exist