Configure Amazon RDS mysql to store Chinese Characters

https://dev.mysql.com/doc/refman/5.7/en/charset-applications.html

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-charactersetname

http://stackoverflow.com/questions/16953232/configure-amazon-rds-mysql-to-store-chinese-characters

How to configure the Amazon RDS to store Chinese Characters in the right way? Currently the text all becomes '????'.

I already created new parameter group and set character set as utf8 and modify the instance. Below are the detail info:

mysql> show variables like '%char%';
+--------------------------+-------------------------------------------+
| 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 | /rdsdbbin/mysql-5.5.27.R1/share/charsets/ |
+--------------------------+-------------------------------------------+ +----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+
asked Jun 6 '13 at 3:24
Yujun Wu

1,19752442
 

3 Answers

After following @Peter Venderberghe's answer to configure RDS, I still can not let it store Chinese characters correctly.

Finally, I used mysql command line to connect to RDS (you can use mysql workbench or other client tool you like)

mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATABASENAME

note:

1). remember to add your current ip to security group inbound of RDS before connecting to RDS

2). you can get related information(security groups, USERNAME...etc) on RDS console besides PASSWORDPASSWORD should be the one you created for the instance. HOSTNAMEORIP is "Endpoint"(without the port) on the console.

3). there is no space between -p and PASSWORD. it's exactly -pPASSWORD.

After connecting to mysql with the tool you are comfortable with, you need to give it some commands:

# set character set and collation for database
mysql> alter database DATABASENAME CHARACTER SET utf8 COLLATE utf8_unicode_ci;
--------
# set character set and collation for new records in a table
mysql> ALTER TABLE TABLENAME CHARACTER SET utf8 COLLATE utf8_unicode_ci;
# set character set and collation for existing records in a table
mysql> ALTER TABLE TABLENAME CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

you may want to write a script to do this task if you have many tables. However, it's not in the scope of this answer.

After configuring as above, you should be able to rock with Chinese characters!

Configure Amazon RDS mysql to store Chinese Characters的更多相关文章

  1. Amazon RDS MySQL数据库还原时 log_bin_trust_function_creators 错误解决办法

    使用了Amazon AWS EC2免费云空间,数据库实例采用Amazon RDS.原来在Windows Server上有一个存在大量数据的MySQL数据库.现在需要在Amazon RDS上还原这个My ...

  2. Amazon RDS的通用型存储(SSD)

    在今年的6月份,我们曾介绍过为Amazon EC2实例提供的基于SSD的弹性块级存储. 在公布几个月过后,这样的被称为通用型存储(SSD)的新型选择方式在创建新的EBS卷中已经占到了90%,我们从客户 ...

  3. Amazon RDS多区域高可用测试

    最近在AWS上面需要部署一组多区域RDS集群,AWS的多区域简单理解就是RDS一主一从分别在当地的两个机房(两个区域).所以就有了下面各方面的测试. 我们需要测试什么? Primary挂掉时,Seco ...

  4. (五)Amazon Lightsail 部署LAMP应用程序之迁移到Amazon RDS实例

    迁移到您的Amazon RDS实例 在某些时候,您的应用程序需求可能需要在 Amazon Lightsail中找不到的功能.幸运的是,将应用程序的一个或所有部分移动到其他AWS服务中非常简单 您将数据 ...

  5. (转)Amazon Aurora MySQL 数据库配置最佳实践

    转自:https://zhuanlan.zhihu.com/p/165047153 Amazon Aurora MySQL 数据库配置最佳实践 AWS云计算 ​ 已认证的官方帐号 1 人赞同了该文章 ...

  6. 云厂商 RDS MySQL 怎么选

    1. 摘要 为了让大家更好的了解各云厂商在RDS MySQL数据库功能上的差异,也为给准备上云的同学做个参考,本文将对阿里云.腾讯云.华为云和AWS 的 RDS MySQL数据库进行对比说明. 从一个 ...

  7. Tapdata Cloud 2.1.5来啦:新增支持Amazon RDS数据库,错误日志查询更便捷,Agent部署细节再优化

      需求持续更新,优化一刻不停--Tapdata Cloud 2.1.5 来啦!   最新发布的版本中,数据连接再上新,同时新增任务报错相关信息快速查询入口,开始支持 JVM 参数自定义设置.   更 ...

  8. RDS MySQL 空间问题的原因和解决

    来源:https://help.aliyun.com/knowledge_detail/41739.html RDS MySQL 空间问题的原因和解决 更新时间:2016-07-22 17:20:14 ...

  9. RDS MySQL 全文检索相关问题的处理

    RDS MySQL 全文检索相关问题 1. RDS MySQL 对全文检索的支持 2. RDS MySQL 全文检索相关参数 3. RDS MySQL 全文检索中文支持 3.1 MyISAM 引擎表 ...

随机推荐

  1. linux环境 c 中如何执行shell命令

    1 system 相当简单: int system(const char *command); system("ps -aux"); 2 popen popen有两个参数,第一个是 ...

  2. MyBatis入门学习(三)

    在实际开发中,我们希望文件配置是分类配置存放,需要的时候引入即可.如果多文件的配置混合配置使用,那么对项目的后期维护将增加难度. 一.对于连接数据库的配置单独放在一个properties文件中 1.对 ...

  3. iOS 常见设计模式

    (一)代理模式/委托模式 应用场景:当一个类的某些功能需要由别的类来实现,但是又不确定具体会是哪个类实现.优势:解耦合敏捷原则:开放-封闭原则实例:tableview的 数据源delegate,通过和 ...

  4. MySQL的Grant命令[转]

    本文实例,运行于 MySQL 5.0 及以上版本. MySQL 赋予用户权限命令的简单格式可概括为: grant 权限 on 数据库对象 to 用户 一.grant 普通数据用户,查询.插入.更新.删 ...

  5. fir.im Weekly - 进击的 Swift

    最近 Swift 开源了,众开发者们欢呼雀跃.感谢开源,这是最好的时代.本期 fir.im Weekly 准备了一些关于 Swift 的"新鲜"干货分享,也包括一些优秀的 GitH ...

  6. python2.7和python3共存

    python2.7和python3共存 原本装了python,玩nodejs的时候需要node-gyp来编译依赖,无赖这货需要python2.5<v<3.0,那就弄两个版本吧 转载自 ht ...

  7. 关于json序列化和反序列的问题,没事写个案例,希望能帮到那些需要帮忙的朋友!

    现在关于json的读写问题,有许许多多的解决方法,因人而异,根据实际问题去选择自己想要的最容易方法.我觉得自带的Newtonsoft.Json是个不错的选择,随便写两个例子吧! 一:关于简单的json ...

  8. Android入门(十九)WebView

    原文链接:http://www.orlion.ga/676/ WebView可以在自己的应用程序中嵌入一个浏览器来展示网页. 创建一个项目WebViewDemo,修改activity_main.xml ...

  9. 了解HTML表单之input元素的23种type类型

    目录 传统类型 text password file radio checkbox hidden button image reset submit 新增类型 color tel email url ...

  10. Ext.Net常用方法

    1.js(Ext)操作 Ext.Msg.alert('系统提示', '未连接血站,该功能暂时不能使用.'); Ext.getCmp("id").getValue();Ext.get ...