yii框架用ar请求数据库的时候 会出现 SHOW FULL COLUMNS FROM `xxxxx`的命令

来源:互联网 发布:spss for mac安装教程 编辑:程序博客网 时间:2024/06/05 19:03

因为我们使用的cache是filecache

common/config/main.php 'cache' => [             'class' => 'yii\caching\FileCache', // 'class' => 'yii\redis\Cache',         ], 

所以修改完数据库表之后 需要删除文件缓存所在的目录 默认的

$cachePath public property The directory to store cache files. You may use path alias here. If not set, it will use the "cache" subdirectory under the application runtime path. public string $cachePath = '@runtime/cache' 

改进的方法是开启schemaCache。

 'db' => [             'class' => 'yii\db\Connection',             'dsn' => 'mysql:host=127.0.0.1;dbname=httpserver',             'enableSchemaCache' => true,             'schemaCacheDuration' => 3600,             'schemaCache' => 'cache',             'username' => 'xxxx',             'password' => 'xxxx',             'charset' => 'utf8',         ],
阅读全文
0 0
原创粉丝点击