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

Server sent charset unknown to the client #10

Closed
borisdiakur opened this issue Apr 20, 2018 · 3 comments
Closed

Server sent charset unknown to the client #10

borisdiakur opened this issue Apr 20, 2018 · 3 comments

Comments

@borisdiakur
Copy link

I’ve done a docker-compose pull today and now after a docker-compose up I’m getting this:

wordpress_1  | Warning: mysqli::mysqli(): Server sent charset (255) unknown to the client. Please, report to the developers in - on line 22
wordpress_1  | 
wordpress_1  | Warning: mysqli::mysqli(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers in - on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2054) Server sent charset unknown to the client. Please, report to the developers
my_wordpress_1 exited with code 1

Any idea what’s wrong here?

@borisdiakur
Copy link
Author

Fixed it in the docker-compose.yaml by changing

db:
    image: latest

to

db:
    image: mysql:5.7

The issue seems to be that MySQL 8 changed the default charset to utfmb4. Is there maybe a better solution than sticking to mysql 5.7?

@nezhar
Copy link
Owner

nezhar commented Apr 25, 2018

Hi @borisdiakur

Thanks for bringing this to my attention :). I think your fix would be ok in most cases.
To change the charset it requires some extra configurations: https://hub.docker.com/_/mysql/ (see Configuration without a cnf file)

On my machine I got an error regarding the authentication to the db. So I will also include the option to revert to the mysql_native_password plugin for authentication in the docker-compose.yml

  db:
    image: mysql:5.7
    ports:
      - 127.0.0.1:3306:3306 # change ip if required
    command: [
        '--default_authentication_plugin=mysql_native_password',
        '--character-set-server=utf8mb4',
        '--collation-server=utf8mb4_unicode_ci'
    ]
    volumes:
      - ./wp-data:/docker-entrypoint-initdb.d
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wordpress-network

This works for latest (8.0), 5.7 and 5.6

@elizavel
Copy link

thank you!

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

3 participants