Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create table error when activing example-plug #31

Open
hbhe opened this issue Jul 14, 2016 · 1 comment
Open

Create table error when activing example-plug #31

hbhe opened this issue Jul 14, 2016 · 1 comment

Comments

@hbhe
Copy link

hbhe commented Jul 14, 2016

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
        ]);
        ....
    }
@kalinichenko88
Copy link

@hbhe set DB_COLLATE 'utf8mb_unicode_ci'. Herbert will use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants