Home>Article>Database> How to modify the mysql character set in the console

How to modify the mysql character set in the console

王林
王林 Original
2020-09-02 14:54:34 2873browse

How to modify the mysql character set in the console: 1. Open the command prompt; 2. Execute the [mysql -uroot -p] command to log in to mysql; 3. Execute the [alter database mydb character set utf8;] command Modify character set.

How to modify the mysql character set in the console

Specific method:

(Learning video tutorial:mysql video tutorial)

1. Modify the database character encoding

mysql> alter database mydb character set utf8;

2. When creating the database, specify the character encoding of the database

mysql> create database mydb character set utf8 ;

(Related recommendations:mysql tutorial)

3. Check the character encoding of mysql database

mysql> show variables like 'character%'; //查询当前mysql数据库的所有属性的字符编码

How to modify the mysql character set in the console

The above is the detailed content of How to modify the mysql character set in the console. 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