首页 热点资讯 义务教育 高等教育 出国留学 考研考公
您的当前位置:首页正文

mysql数据库默认编码配置

2023-11-09 来源:花图问答

修改my.ini文件

以下添加
[mysql] 
default-character-set=utf8
[mysqld]

character_set_server = utf8
init_connect=‘SET NAMES utf8‘


修改完毕后重新启动后,查看下面的参数。

mysql> show variables like ‘character%‘;
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+

character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8


8 rows in set (0.01 sec)

mysql> show variables like ‘coll%‘;
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

mysql数据库默认编码配置

标签:

显示全文