• 修改linux 下 mysql编码


    在做全文索引的时候,由于mysql编码问题,导致php文件测试时显示乱码,同时中文索引没有用。

    查看默认编码 show variables like 'character%'

    查看默认排序方式 show variable like 'collation_%'

    解决方法:

    修改配置文件 /etc/my.cnf

    在 [client] 下添加

    default-character-set=utf8

    [mysqld] 下添加

    character-set-server=utf8
    33 init_connect='SET NAMES utf8'

    修改后重启 mysql 服务 service mysqld restart 即可

    再次查看默认编码 show variables like 'character%'

    mysql> show variables like 'character%';
    +--------------------------+----------------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | utf8 |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | utf8 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/local/mysql/share/charsets/ |
    +--------------------------+----------------------------------+

    查看默认排序

    mysql> show variables like 'collation_%';
    +----------------------+-----------------+
    | Variable_name | Value |
    +----------------------+-----------------+
    | collation_connection | utf8_general_ci |
    | collation_database | utf8_general_ci |
    | collation_server | utf8_general_ci |
    +----------------------+-----------------+

    这样 就好了,coreseek的中文索引也可以用了。

  • 相关阅读:
    java.net.BindException: Address already in use: bind
    修改Oracle 10g Express Edition默认的8080端口
    五虎
    easily add files to META-INF in NetBeans
    http://edu.makery.ch/
    JavaFX 2 Dialogs
    JavaFx版本植物大战僵尸
    CSS样式表——布局练习(制作360网页)
    CSS样式表
    CSS样式表——超链接样式
  • 原文地址:https://www.cnblogs.com/turtle1991/p/3770178.html
Copyright © 2020-2023  润新知