zoukankan      html  css  js  c++  java
  • 存储emoji表情,修改字符集为utf8mb4

    SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';

    SET character_set_client = utf8mb4;
    SET character_set_connection = utf8mb4;
    SET character_set_database = utf8mb4;
    SET character_set_results = utf8mb4;
    SET character_set_server = utf8mb4;

    ALTER DATABASE 数据库名 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

    ALTER TABLE tableName CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

    ALTER TABLE tableName  CHANGE `content` `content` LONGTEXT CHARACTER SET utf8mb4

    另外my.ini(此文件在tomcat安装目录和bin在同级)文件要修改这几处:

    [client]
    default-character-set = utf8mb4

    port=3306

    [mysql]
    default-character-set = utf8mb4
     
    [mysqld]
     
     
    character-set-server = utf8mb4
     
     


    # The default storage engine that will be used when create new tables when
    default-storage-engine=INNODB

    # Set the SQL mode to strict
    sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  • 相关阅读:
    MySql索引
    HashMap 底层解析
    https超文本安全传输协议
    多线程
    过滤器和拦截器
    计算机操作系统
    计算机网络
    java线程内存模型JMM
    jvm
    数据库
  • 原文地址:https://www.cnblogs.com/duanqiao123/p/8488142.html
Copyright © 2011-2022 走看看