AWS Aurora MySQL5.7 호환 문자 코드를 utf8mb4로 변경
환경
실시한 것
Aurora의 경우 두 가지 유형의 매개 변수 그룹이 있으며 문자 코드를 변경할 때 클러스터의 매개 변수 그룹에서 변경해야합니다.
Amazon Aurora MySQL 참조
RDS MySQL5.7에서 Aurora MySQL5.7 호환으로 마이그레이션했을 때 의외로 Aurora 기사가 적었기 때문에.
전제 조건
이미 Aurora를 빌드하고 인스턴스도 시작된 상태로 만듭니다.
클러스터의 매개 변수 그룹 만들기
매개 변수 그룹 만들기를 선택합니다.

유형으로 DB Cluster Parameter Group을 선택하여 작성합니다.

파라미터 그룹 편집
작성한 파라미터 그룹에서 편집합니다.

이번에는 다음 파라미터를 utf8mb4로 변경했습니다.
character_set_client
character_set_connection
character_set_database
character_set_results
character_set_server
DB 클러스터의 매개 변수 그룹 변경
클러스터 메뉴에서 클러스터 변경을 선택합니다.

DB 클러스터의 파라미터 그룹을 위에서 만든 파라미터 그룹으로 설정하여 클러스터를 변경합니다.

제 경우에는 개발중인 환경이었으므로 즉시 적용을 선택하고 만약을 위해 인스턴스를 다시 시작했습니다 (재부팅이 필요하지 않을 수 있습니다).
변경 확인
DB 인스턴스에 MySQL 로그인하여 확인.
mysql> show global variables like 'character%';
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
데이터베이스가 벌써 작성되고 있는 경우는, 데이타베이스의 문자 코드 변경을 한다.
mysql> use DB名
Database changed
mysql> show variables like "chara%";
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8mb4 |
mysql> set character_set_client = utf8mb4;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_connection = utf8mb4;
Query OK, 0 rows affected (0.01 sec)
mysql> set character_set_database = utf8mb4;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> set character_set_results = utf8mb4;
Query OK, 0 rows affected (0.01 sec)
mysql> set character_set_server = utf8mb4;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like "chara%";
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
참고
이하 기사가 매우 참고가 되었습니다. 고마워요.
MySQL 문자 코드를 utf8mb4로 변경
여담 : 오로라 소감
현재 MySQL과 같이 취급할 수 있습니다.
Reference
이 문제에 관하여(AWS Aurora MySQL5.7 호환 문자 코드를 utf8mb4로 변경), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ein-san/items/ed192526f68ceb1ec60b
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
mysql> show global variables like 'character%';
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
mysql> use DB名
Database changed
mysql> show variables like "chara%";
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8mb4 |
mysql> set character_set_client = utf8mb4;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_connection = utf8mb4;
Query OK, 0 rows affected (0.01 sec)
mysql> set character_set_database = utf8mb4;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> set character_set_results = utf8mb4;
Query OK, 0 rows affected (0.01 sec)
mysql> set character_set_server = utf8mb4;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like "chara%";
+--------------------------+---------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
이하 기사가 매우 참고가 되었습니다. 고마워요.
MySQL 문자 코드를 utf8mb4로 변경
여담 : 오로라 소감
현재 MySQL과 같이 취급할 수 있습니다.
Reference
이 문제에 관하여(AWS Aurora MySQL5.7 호환 문자 코드를 utf8mb4로 변경), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ein-san/items/ed192526f68ceb1ec60b
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여(AWS Aurora MySQL5.7 호환 문자 코드를 utf8mb4로 변경), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ein-san/items/ed192526f68ceb1ec60b텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)