其他分享
首页 > 其他分享> > 2021-07-12

2021-07-12

作者:互联网

UTF8与UTF-8区别
前段时间写mybatis 连接Mysql数据库时 这个点卡了老长时间
XML 文件设置编码格式 UTF-8 但数据库不识别;
Mysql 数据库只识别 UTF8

<?xml version="1.0" encoding="UTF8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--核心配置文件-->
<configuration>
    <!--<typeAliases>
        <package name="com.lhw.pojo"/>
    </typeAliases>-->
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"></transactionManager>
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/mybatis?s
            useSSL=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
                <property name="username" value="root"/>
                <property name="password" value="0000"/>
            </dataSource>
        </environment>
    </environments>

    <mappers>
        <mapper resource="com/lhw/dao/UserMapper.xml"/>

    </mappers>

</configuration>

标签:12,UTF,07,点卡,UTF8,数据库,2021,Mysql,识别
来源: https://blog.csdn.net/L_virus/article/details/118667979