Home  >  Q&A  >  body text

mysql在控制台下显示乱码,请假各位大神

在百度上搜过一些方法:
比如 1. 设置my.ini 文件,但本人mysql5.6 解压包里面只有my-default.ini,在这个文件里面添加 default-character-set=utf8,但exit 退出数据库,重新登录还是没有用; 2. 直接在命令行语句中设置 set names gbk; 也没有用,并且在我退出数据库,重新登录后,关于字符编码的设置又恢复到原来的样子。

PHPzPHPz2743 days ago693

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 14:44:35

    You should use administrator rights to change it

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 14:44:35

    Your console encoding is wrong

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:44:35

    Those settings cannot essentially solve the problem. The crudest method is to back up your database tables first, that is, export the sql file, uninstall the mysql database and then reinstall it. One step during the installation process is to set the encoding format. Once you set UTF-8, it won’t be garbled

    reply
    0
  • Cancelreply