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.
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数据库的所有属性的字符编码
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!