• PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers


    微擎出错信息:

    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers' in /data/backup/weifang/framework/class/db.class.php:55 Stack trace: #0 /data/backup/weifang/framework/class/db.class.php(55): PDO->__construct('mysql:dbname=we...', 'root', 'gPYD3t24', Array) #1 /data/backup/weifang/framework/class/db.class.php(25): DB->connect(Array) #2 /data/backup/weifang/framework/function/pdo.func.php(19): DB->__construct(Array) #3 /data/backup/weifang/framework/function/pdo.func.php(65): pdo() #4 /data/backup/weifang/framework/function/cache.mysql.func.php(9): pdo_getcolumn('core_cache', Array, 'value') #5 /data/backup/weifang/framework/function/cache.func.php(39): cache_read('setting') #6 /data/backup/weifang/framework/model/setting.mod.php(34): cache_load('setting') #7 /data/backup/weifang/framework/bootstrap.inc.php(129): setting_load() #8 /data/backup/weifang/index.php(6): require('/data/backup/we...') #9 {main} thrown in /data/backup/weifang/framework/class/db.class.php on line 55

    换成mysql 8.0了,其默认编码修改成了utfmb4,需要修改配置文件:

    [client]
    default-character-set=utf8
    
    [mysql]
    default-character-set=utf8
    
    
    [mysqld]
    collation-server = utf8_unicode_ci
    character-set-server = utf8

    完毕。

  • 相关阅读:
    泛型的运用
    LinkdList和ArrayList异同、实现自定义栈
    MD5文件去重
    mysql协议解析
    solrconfig.xml主要配置项
    自定义特性使用
    使用OWIN 为WebAPI 宿主 跨平台
    Web.config配置文件详解
    IIS 之 在IIS7、IIS7.5中应用程序池最优配置方案
    GitHub 创建工程
  • 原文地址:https://www.cnblogs.com/zl0372/p/weiqing.html
Copyright © 2020-2023  润新知