mysql???????????????????????
???????????? ???????[ 2014/4/21 15:49:44 ] ????????????? ????
mysql???????????????Latin1???????????????????gbk/utf8?????????
1????root????????????????????
???????>mysql -u root –p ?????????????????????????????
show variables like 'character%';
?????????£?
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
??????????????????? ??????????????????????gbk??utf8.
character_set_client????????????
character_set_connection????????????????
character_set_database?????????
character_set_results??????????
character_set_server???????????????
?????????????????????????????????????????
2????????????????裺
1????mysql????
2?????mysql?????????
windows?????·???μ??my.ini
linux??·????????/etc/mysql/my.cnf
3)????????????[client] ?????????
default-character-set=utf8 ?????????utf8
4???????[mysqld] ???
default-character-set=utf8 ?????????utf8
init_connect='SET NAMES utf8' ???趨????mysql?????????utf8????????mysql??????utf8???У?
5?????ú????????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 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
3??MySQL???????????????????????????????????????????м???????????????????μ???????
?????????????????????????????????????
1??CREATE DATABASE ms_db CHARACTER SET utf8 COLLATE utf8_general_ci??
2??create database if not exists netctoss default character set utf8;
3??????????????????????????????????????????????????磺jdbc:mysql://localhost:3306 /mysql?useUnicode=true&characterEncoding=utf-8(???????????κο?????????)
4????Commandline????????????????????????????
set names gbk(???????UTF-8) ???????????????????????????????
???set names gbk????????character_set_client??character_set_connection?? character_set_results?????????????????????????????????????????Ч?????′????????Ч??????????????????????????????????utf8??????洢??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11