This topic is locked

Configuring MySQL 8

11/10/2020 1:15:18 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

MySQL 8, unfortunately, breaks some PHP compatibility. Luckily, there are some very simple tweaks are available that can get you running in no time.

  1. If you are getting "Server sent charset unknown to the client. Please, report to the developers" error message you need to specify the default charset in MySQL 8 config file.
    Config file is named my.ini and on Windows server, it is usually located in C:\ProgramData\MySQL\MySQL Server 8.0 folder. You need to find [mysqld] section and make sure that the following two lines are in there:

[mysqld]

collation-server = utf8_unicode_ci

character-set-server = utf8


Restart your MySQL service after that. The following screenshot explains how to find the location of my.ini on your computer.


2. The second error is authentication-related and looks like "Authentication method unknown to the client". If you encounter this error run the following commands using your favorite MySQL client software:

ALTER USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword';

FLUSH PRIVILEGES;


Replace 'myuser' and 'mypassword' with your MySQL username and password.
Happy coding!