More than 1 year has passed since last update.



* config/app.phpのDatasources

'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
             * CakePHP will use the default DB port based on the driver selected
             * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
             * the following line and set the port accordingly
            //'port' => 'nonstandard_port_number',
            'username' => 'user',
            'password' => 'password',
            'database' => 'test',
            'encoding' => 'utf8',
            'timezone' => 'Asia/Tokyo',
            'cacheMetadata' => true,

             * Set identifier quoting to true if you are using reserved words or
             * special characters in your table or column names. Enabling this
             * setting will result in queries built using the Query Builder having
             * identifiers quoted when creating SQL. It should be noted that this
             * decreases performance because each query needs to be traversed and
             * manipulated before being executed.
            'quoteIdentifiers' => false,

             * During development, if using MySQL < 5.6, uncommenting the
             * following line could boost the speed at which schema metadata is
             * fetched from the database. It can also be set directly with the
             * mysql configuration directive 'innodb_stats_on_metadata = 0'
             * which is the recommended value in production environments
            //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  • config/bootstrap.php



SQLSTATE[HY000]: General error: 1298 Unknown or incorrect time zone: 'Asia/Tokyo'


mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.