我使用带有web服务的glassfish来访问/编写mysql数据库。问题出在mysql中:当插入英文字符时,一切看起来都不错,但插入时,比如希伯来字符,行显示为反转。解释相反的事情:让我们假设表myTable具有以下结构
+----------+------------------+------+-----+---------+----------------+
| Field | Type | ..
+----------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | ...
| artist | varchar(64) | ...
| title | varchar(64) | ...
| genre | varchar(128) | ...
| filename | varchar(512) | ...
| uploaded | tinyint(1) | ...
+----------+------------------+------+-----+---------+----------------+
这就是英语和希伯来语字母的样子:
我已经设置了字符集和整理(尽管在创建数据并将数据插入数据库之后):
+--------------------------+----------------------------+
| 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/ |
+--------------------------+----------------------------+
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
甚至编辑了my.cnf:
[mysqld]
skip-character-set-client-handshake
character-set-server = utf8
init-connect='SET NAMES utf8'
collation-server=utf8_general_ci
任何帮助表示感谢。