Resolving MySQL Database Insert data There is a question mark (? ) Solution _mysql

Source: Internet
Author: User

First of all, I use the MySQL database is 5.7.12 version.

The problems that arise:

1. Insert data display error, insert unsuccessful, appear: incorrect string value: ' \XCD\XF5\XD5\XBC\XBE\XA9 ' for column ' sname ' at row 1

2. Insert Chinese, although inserted successfully, but show:??

Workaround:

Add #character to [mysqld] in the My.ini file-set-server=utf8

As shown in the picture, must be above the blue circle, that is, the content of the blue circle must be at the bottom of [mysqld], or simply cannot log in to the database.

If the above solution is still not solved? The problem,

When you connect to a database, add a useunicode=true&characterencoding=utf-8 this sentence. As shown below:

"Jdbc:mysql://localhost:3306/sgmanagement?useunicode=true&characterencoding=utf-8";

Online There are also said: under [mysqld] to join #default-character-set=utf8, but I do not use.

The above is a small series to introduce you to solve the MySQL database insert data to appear question mark (? Solution, hope to help everyone, if you want to know more content please pay attention to cloud Habitat community website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.