您可以分别截断/删除每个表,其开始于cache_
:
DELETE FROM cache;
DELETE FROM cache_block;
依此类推(通过 drush sqlq "SHOW TABLES LIKE 'cache_%'"
)。
或生成带有表列表的查询,并传递到drush来截断它们,例如:
echo "SHOW TABLES LIKE 'cache%'" | $(drush sql-connect) | tail -n +2 | xargs -L1 -I% echo "DELETE FROM %;" | $(drush sql-connect) -v
要么:
echo "SELECT CONCAT('DELETE FROM ', GROUP_CONCAT(TABLE_NAME SEPARATOR ';DELETE FROM ') , ' cache;' ) AS statement FROM information_schema.TABLES WHERE TABLE_NAME LIKE 'cache_%'" | drush sqlc --extra=--skip-column-names | drush sqlc
记忆快取
如果您使用的是memcached,则还需要刷新那里的缓存,例如(Bash语法):
echo flush_all > /dev/tcp/127.0.0.1/11211