将现有的cakephp 3.0数据库迁移到mysql的postgres

我正在将cakephp 3.0数据库从
mysql迁移到postgress.我使用
this工具进行数据库迁移,它运行得很漂亮.之后我更改了配置文件,如下所示.

  'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Postgres',
            'persistent' => false,
            'host' => 'localhost',
            'port' => '5432',
            'username' => 'postgres',
            'password' => 'mypass',
            'database' => 'cake_bookmarks',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,
            'log' => false,
            'quoteIdentifiers' => false,

            //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
        ],

localhost中的根文件夹还显示“已成功连接到数据库”.但是,当我运行我的应用程序时,它显示一个错误:

Cannot describe mytable. It has 0 columns. Cake\Database\Exception

我不能确定这是因为没有连接到数据库(我认为不太可能,因为根页显示为连接)或cakephp无法使用我的数据库.
如果是这样,我该如何解决问题.我对cakephp也很陌生,只是简单地做一些基本的事情.

最佳答案 尝试以下(每个步骤后测试):

>检查数据库中是否存在该表
>检查表中是否定义了预期的列
>清除Cake缓存(如果FileCache足以删除tmp / cache / persistent tmp / cache / models和tmp / cache / views下的文件
>检查数据库cake_bookmarks上特定用户的权限(可能通过phppgadmin)

希望能帮到你!

点赞