Mysql 数据库错误:异常错误:SQLSTATE[HY000][1045]
我在获取错误的服务器上配置网站,CakePHP 3,但当我将浏览器指向某个链接时,会出现以下错误: config/app.phpMysql 数据库错误:异常错误:SQLSTATE[HY000][1045],mysql,apache,ubuntu,cakephp,Mysql,Apache,Ubuntu,Cakephp,我在获取错误的服务器上配置网站,CakePHP 3,但当我将浏览器指向某个链接时,会出现以下错误: config/app.php If you want to customize this error message, create src/Template/Error/pdo_error.ctp 修复了该问题,使用了以下DB主机名连接: 'Datasources' => [ 'default' => [ 'className' =>
If you want to customize this error message, create src/Template/Error/pdo_error.ctp
修复了该问题,使用了以下DB主机名连接:
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'username',
'password' => 'password ',
'database' => 'DB name',
'encoding' => 'utf8',
'timezone' => 'UTC',
'cacheMetadata' => true,
'quoteIdentifiers' => false,
'log' => false,
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
'url' => env('DATABASE_TEST_URL', null),
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'username',
'password' => 'password ',
'database' => 'DB name',
'encoding' => 'utf8',
'timezone' => 'UTC',
'cacheMetadata' => true,
'quoteIdentifiers' => false,
'log' => false,
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
'url' => env('DATABASE_TEST_URL', null),