Mybatis Error: The server time zone value ‘����1532a0’ is unrecognized

The first time to install and use mybatis, problems encountered are as follows:

Question 1: Unkonwn database ‘test’

I created a new test database in my own database, and the corresponding table name, the problem was solved. However, what I want to understand is: how to specify which database and which table to use in the XML configuration file, otherwise, this problem will appear.

Question 2: The server time zone value ‘appears in MySQL й ��� ׼ʱ ‘is unrecognized record

Solution 1: modify the database time zone
set global time_ zone = ‘+8:00’; ## Modify the global time zone of Mysql to Beijing time, that is, the East 8 district where we are
in the database   set time_ zone = ‘+8:00’; ## Modify the time zone of the current session
0   flush privileges; # Effective immediately

Solution 2: modify the value of driver and URL.

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Pay attention to this configuration header tag, don't make a mistake -->
<!DOCTYPE configuration
        PUBLIC "-// Config 3.0//EN"

    <environments default="bank">
        <environment id="bank">
            <!-- Using jdbc transaction management -->
            <transactionManager type="JDBC" />
            <!-- Database connection pooling -->
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.cj.jdbc.Driver" />  
                <property name="url"
                          value="jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" />
                <property name="username" value="root" />
                <property name="password" value="123456" />

    <!-- This place configures the entity class sql mapping file -->
        <mapper resource="pufaSpring\otherMybatis\UserMapper.xml"/>


Read More: