Home  >  Article  >  Database  >  What is the command to set encoding in mysql?

What is the command to set encoding in mysql?

王林
王林Original
2020-09-27 17:10:503008browse

The command for mysql to set encoding is: [SET character_set_database = utf8;]. We can view the database encoding by executing the [SHOW VARIABLES LIKE '%set%';] command.

What is the command to set encoding in mysql?

1. Check the encoding

(Recommended tutorial: mysql video tutorial )

SHOW VARIABLES LIKE '%set%';

2. Set the encoding to UTF-8

SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_database = utf8;
SET character_set_results = utf8;
SET character_set_server = utf8;
SET character_set_system = utf8;

Related recommendations: php training

The above is the detailed content of What is the command to set encoding 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