› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
gootor
V2EX  ›  MySQL

我现在遇到的乱码问题,请求协助。。

  •  
  •   gootor · Mar 6, 2015 · 4339 views
    This topic created in 4220 days ago, the information mentioned may be changed or developed.
    环境:3.1 utf8版本,前后台正常,但是通过pma查看数据库,发现显示乱码。
    问题:我现在要迁移到新的服务器,把文件拷贝到新服务器,数据库导出来为sql文件,通过文本编辑器看是乱码,然后导入新服务器数据库,前台后台牵扯中文的地方都是乱码,请问问题可能在哪儿?如何解决?

    http://wenda.wecenter.com/uploads/questions/20150305/c51d2d03f6bd4db94767b1c3c64a69c1.png
    6 replies  •  2015-03-06 15:48:35 +08:00
    joyeblue
        1
    joyeblue  
       Mar 6, 2015
    在查询语句之前,执行set names utf8;
    在看看。
    Arrowing
        2
    Arrowing  
       Mar 6, 2015
    先看看表结构是什么编码,再看看pma的html页面使用什么编码
    如果都是utf8的话,那是不是存入的时候以gbk存入了?
    gootor
        3
    gootor  
    OP
       Mar 6, 2015
    @joyeblue 这种方法不行 换任意编码格式都是错码
    joyeblue
        4
    joyeblue  
       Mar 6, 2015
    如果方便给出建表语句(show create table 表名) ,导出数据库语句,导入数据库语句就比较好分析。
    iscraft
        5
    iscraft  
       Mar 6, 2015
    选择正确的编码进入pma查看 或者一开始你的库就不是utf-8的
    Jack
        6
    Jack  
       Mar 6, 2015
    @iscraft 这个可能性最大
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2524 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:46 · PVG 09:46 · LAX 18:46 · JFK 21:46
    ♥ Do have faith in what you're doing.