Giter VIP home page Giter VIP logo

Comments (4)

hankcs avatar hankcs commented on June 16, 2024

请问如何解决这个问题呢?

from questionansweringsystem.

hankcs avatar hankcs commented on June 16, 2024

我看第一个issue也是这个问题
#1

from questionansweringsystem.

hankcs avatar hankcs commented on June 16, 2024

自行解决了,请参考pull request

from questionansweringsystem.

ysc avatar ysc commented on June 16, 2024

1、查看MySQL是不是utf8编码
执行如下命令:show variables like "%character%"; show variables like "%collation%";
如果是utf8编码则显示如下:
mysql> show variables like "%character%"; show variables like "%collation%";
+--------------------------+--------------------------------------------------------+
| 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-5.6.20-osx10.8-x86_64/share/charsets/ |
+--------------------------+--------------------------------------------------------+
8 rows in set (0.00 sec)

+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

2、如果不是utf8编码,Mac下的MySQL-5.6.20可通过如下方法修改,其他平台和版本请查询谷歌:
2.1、复制配置文件:
sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
2.2、修改my.cnf:
新增:
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
在[mysqld]下新增:
character-set-server=utf8
2.3、重新启动MySQL服务:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart

3、改完编码后删除数据库,重新执行脚本src\main\resources\mysql\questionanswer.sql

from questionansweringsystem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.