How to output Chinese character information in mysql

王林
Release: 2020-10-19 10:55:30
Original
4061 people have browsed it

mysql输出汉字信息的方法:执行【create database abcd DEFAULT CHARACTER SET utf8;】语句修改默认编码为utf8即可。

How to output Chinese character information in mysql

MySQL查询代码:

(推荐教程:mysql视频教程

show variables like'%char%';
Copy after login

输出的结果只要将其中的Latin改成utf8就可以了.

在创建数据库的时候修改默认编码为utf8:

create database abcd DEFAULT CHARACTER SET utf8;
Copy after login

创建好表以后可以直接用:

show create database databasename;(databasename是你创建数据库的名字)
Copy after login

来查看结果,之后要是在创建新表的话,就可以直接输入中文了。

相关推荐:mysql教程

The above is the detailed content of How to output Chinese character information in mysql. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!