CakePHP Database connection “Mysql” is missing, or could not be created

后端 未结 18 1404
暖寄归人
暖寄归人 2020-11-30 11:05

There have been several other posts about this, but none of the answers seemed to work for me.

When I navigate to the CakePHP page on my local machine, there is one

18条回答
  •  暖寄归人
    2020-11-30 11:25

    An alternative to unix_socket (especially for OS X people) is to replace localhost with 127.0.0.1

    Would be as Follows :

    public $default = array(
                    'datasource' => 'Database/Mysql',
                    'persistent' => false,
                    'host' => '127.0.0.1',
                    'login' => 'user',
                    'password' => 'password',
                    'database' => 'database-name',
                    'prefix' => '',
                    'encoding' => 'utf8',
            );
    

提交回复
热议问题