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. eclipse启动不了

    因为eclipse运行变得非常慢,我想再次增加一下eclipse的最大内存,以期待使eclipse能够快速的响应. 参照某些资料,我也不知道什么时候改成了这样: -vmargs-Xms512m-Xmx ...

  2. jmx完整示例

    很早就开始去了解这个了,不过一直都是皮毛,基本概念明白,具体api几乎一无不知... 认真看了几篇文章,做了测试,终于有所了解 参考 入门级别: http://www.cnblogs.com/agou ...

  3. 我心中的核心组件(可插拔的AOP)~调度组件quartz.net

    回到目录 quartz.net是一个任务调度组件,它可以灵活的设置你的调试方式,按时间,按日期,按周期都可以很容易的实现,quartz不仅可以用在web中,而且还可以部署在winform,winser ...

  4. Asp.Net实现无刷新文件上传并显示进度条(非服务器控件实现)(转)

    Asp.Net实现无刷新文件上传并显示进度条(非服务器控件实现) 相信通过Asp.Net的服务器控件上传文件在简单不过了,通过AjaxToolkit控件实现上传进度也不是什么难事,为什么还要自己辛辛苦 ...

  5. win2003 64位系统IIS6.0 32位与64位间切换

    ASP.NET 1.1,32 位版本 要运行 32 位版本的 ASP.NET 1.1,按照以下步骤操作: 1.单击“开始”,单击“运行”,键入 cmd,然后单击“确定”. 2.键入以下命令启用 32 ...

  6. Java EE开发平台随手记3——Mybatis扩展2

    忙里偷闲,继续上周的话题,记录Mybatis的扩展. 扩展5:设置默认的返回结果类型 大家知道,在Mybatis的sql-mapper配置文件中,我们需要给<select>元素添加resu ...

  7. Python之函数与变量

    本节内容 函数介绍及其作用 函数的定义与调用 函数的参数说明 全局变量与局部变量 值传递和引用传递 一.函数的介绍及其作用 编程语言中的函数与数学中的函数是有区别的:数学中的函数有参数(输入),就会有 ...

  8. java webservice 总结(学会读别人的webservice并且通过代理模式访问)

    公司做的系统之间的交互用到了webservice做交互,现在对webservice做一个总结. 1.配置已有的webservice webservice主要包括 xml/json:作为传输数据的格式 ...

  9. PHP将富文本编辑后的内容,去除样式图片等只保留txt文本内容

    1.从数据库读取富文本内容样式如下: <p style=";text-indent: 0;padding: 0;line-height: 26px"><span ...

  10. file:///Users/xmg/Desktop/xiangmu~Bsbdejie/BaisibudejieTheSecondtime/BaisibudejieTheSecond/BaisibudejieTheSecond/AppDelegate.m: warning: Missing file: /Users/xmg/Desktop/xiangmu~Bsbdejie/BaisibudejieT

    warning: Missing file: is missing from working copy fatal error: file '-.h' has been modified since ...