The current encoding of MYSQL data is like this. Why is it still garbled when inserting Chinese characters?

WBOY
Release: 2016-08-04 09:19:33
Original
1022 people have browsed it

Do I need to change the rest of the database and server? I use wamp and I don’t know how to change it. After setting it up like this and restarting, it looks like in the picture

<code>SET character_set_database = utf8;
SET character_set_server = utf8;
</code>
Copy after login
Copy after login

I have set three
[client] [mysql] [mysqld] in my.ini. These three settings have become utf8 and it doesn’t work either
The current encoding of MYSQL data is like this. Why is it still garbled when inserting Chinese characters?

Reply content:

Do I need to change the rest of the database and server? I use wamp and I don’t know how to change it. After setting it up like this and restarting, it looks like in the picture

<code>SET character_set_database = utf8;
SET character_set_server = utf8;
</code>
Copy after login
Copy after login

I have set three
[client] [mysql] [mysqld] in my.ini. These three settings have become utf8 and it doesn’t work either
The current encoding of MYSQL data is like this. Why is it still garbled when inserting Chinese characters?

<code>+--------------------------+-----------------------------------------------------------------+
| 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</code>
Copy after login

Is the question inserted through the web page or the terminal?

There is also the encoding of the table. The key lies in the encoding of the table

<code>create table employee
(
  //..............
) DEFAULT CHARSET=utf8;</code>
Copy after login

Write the table creation statement like this, and set the encoding of the table to utf-8, which may solve the problem.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template