1
I am developing a web application using version 3.1.9 of Codeigniter
, but I’m having difficulties connecting to the database.
Follows configuration:
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => 'mysql:host=localhost; port=3306; dbname=tarifador; charset=utf8',
'hostname' => 'localhost',
'username' => 'root',
'password' => '******',
'database' => 'tarifador',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Error presented:
A PHP Error was encountered
Severity: Warning
Message: PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers
Filename: pdo/pdo_driver.php
Line Number: 136
Backtrace:
File: C:\xampp\htdocs\index.php
Line: 315
Function: require_once
A Database Error Occurred
SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers
Filename: C:/xampp/htdocs/system/database/drivers/pdo/pdo_driver.php
Line Number: 142
In the database Schema is already configured as UTF8 e UT8_general_ci
.
I’ve also tried using the driver mysqli
.
Additional details: PHP version: 5.6.37 Mysql Version: 8.0.12
Grateful to those who can help
There is this case of the OS. If it works, consider translating it to Sopt to help more colleagues. https://stackoverflow.com/questions/43437490/pdo-construct-server-sent-charset-255-unknown-to-the-client-please-rep
– Andre Mesquita
I have tried this solution, but the problem remains.
– Rodrigo Roberto de Almeida