Incubator-superset: encoding utf8

Created on 7 Jun 2016  ·  5Comments  ·  Source: apache/incubator-superset

When I use caravel to connet localhost MySQL database to create a slice, a encoding problem disturbed me a lot.
Some of the tables in my database are encoded in utf8_general_ci. When I called one of this table and created a slice, the Chinese items are displayed as messy code like "???",so how can I resolve this problem?

Thanks,

Most helpful comment

@chejinye 在数据库名字最后加上 ?charset=utf8

All 5 comments

你 怎么 解决的 ,我也遇到这个问题 @ @ @birdspring

@chejinye 在数据库名字最后加上 ?charset=utf8

OperationalError: (_mysql_exceptions.OperationalError) (2019, "Can't initialize character set 'utf8 ' (path: /usr/share/mysql/charsets/)") 但是我的还是错误

@chejinye 首先你本机或者服务器内需要安装mysql,用pip install mysqlclient安装mysql客户端,apt-get安装(ubuntu)也可以。
其次连接mysql数据库的标准uri是 mysql://root:password@localhost/databasename?charset=utf8
用户名与密码是你mysql自己设置的,localhost是你对应的ip,服务器的话自己配置,数据库名字就是你要连接的数据库名,必须提前在mysql中创建,这样点test connection。
如果你用的是caravel自带的例子的话用非sqlite数据库会出现一些问题,这个就是另一个方面了

谢谢,中文能正常显示了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eliab picture eliab  ·  3Comments

deity-bram picture deity-bram  ·  3Comments

ylkjick532428 picture ylkjick532428  ·  3Comments

shyam2794 picture shyam2794  ·  3Comments

kalimuthu123 picture kalimuthu123  ·  3Comments