Home > Database > Mysql Tutorial > c++ 连接mysql 中文乱码_MySQL

c++ 连接mysql 中文乱码_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:34:51
Original
1292 people have browsed it

bitsCN.com

关于mysql编码问题的设置:

http://www.bitsCN.com/database/201108/101151.html

 

问题简述:

环境:linux

mysql编码设置:

终端插入中文,然后查看,不乱。

phpmyadmin插入中文,然后查看,不乱。

php连接 设置mysql_query("SET NAMES UTF8"),查看,由终端或phpmyadmin插入的都不乱。

唯一乱的是c++写进去的中文,全变乱码了。

解决:

c++里面数据库连接完了,加上

还不行,为啥呢?右键清空项目,再重新编译执行,不乱码了。

所以以后debug的时候记得清空项目后重新编译。

bitsCN.com
Related labels:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template