Skip to content

Create table error when activing example-plug #31

@hbhe

Description

@hbhe

in wp-config.php

define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', ''); 

herberit will use 'utf8_general_ci collate, but it is not matched with utf8mb4 charset,
Mysql error occurs

 protected function registerEloquent()
    {
        global $wpdb;

        $capsule = new Capsule($this->app);

        $capsule->addConnection([
            'driver' => 'mysql',
/*            
            'host' => DB_HOST,
            'database' => DB_NAME,
            'username' => DB_USER,
            'password' => DB_PASSWORD,
            'charset' => DB_CHARSET,
            'collation' => DB_COLLATE ?: 'utf8_general_ci',
*/            
            'host' => $wpdb->dbhost,            
            'database' => $wpdb->dbname,            
            'username' => $wpdb->dbuser,            
            'password' => $wpdb->dbpassword,            
            'charset' => $wpdb->charset,            
            'collation' => $wpdb->collate,            

            'prefix' => $wpdb->prefix
        ]);
        ....
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions