mysql编码问题:

时间:2021-05-10 04:43:22

在my.ini文件改为:

[client]
default-character-set = utf8
port=3306

[mysql]

default-character-set=utf8

[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306

# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8

在控制台:

mysql  -uroot -p123456

use test

查看表:

show create table room;

sql语句:

alter table users convert to character set utf8;