Home  >  Article  >  Database  >  How to output Chinese character information in mysql

How to output Chinese character information in mysql

王林
王林Original
2020-10-16 15:41:043991browse

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

How to output Chinese character information in mysql

MySQL查询代码:

(推荐教程:mysql视频教程

show variables like'%char%';

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

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

create database abcd DEFAULT CHARACTER SET utf8;

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

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

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

相关推荐: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!

Statement:
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