spark-shell字符集长度不够
来源:5-5 spark-shell&spark-sql的使用
qq_Leonardo_2
2018-11-19
mysql> SHOW VARIABLES LIKE ‘character%’;
±-------------------------±---------------------------+
| Variable_name | Value |
±-------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
如上表,字符集已经改过latin了,utf8也试过,还是报长度不够的错误,敢问我是不是得升级mysql了
2回答
-
如下操作:
第一步:重新创建一个数据库
第二步:把这数据库的字符集改成latin1,注意是为这个库改字符集,然后刷新
第三步:启动spark-shell
022018-11-19 -
qq_Leonardo_2
提问者
2018-11-19
如果不想升级mysql的话我贴上我的字符集设置,升级之后的区别就是character_set_server =latin1(问题贴的代码上是utf8)不知道会不会有什么联系,我还需要继续查阅资料
mysql> show variables like "%char%";
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/charsets/ |
+--------------------------+----------------------------------+
8 rows in set (0.00 sec)
022018-11-19
相似问题