From f8bb552679703d36a1b2b61e1c05f78f6449f0e5 Mon Sep 17 00:00:00 2001 From: Nimsara Fernando Date: Mon, 27 Apr 2026 15:05:45 +0530 Subject: [PATCH] Update Database Change Documentation to Enforce Case Sensitivity --- .../changing-to-ibm-db2.md | 3 +++ .../changing-to-mysql.md | 24 ++++++++++++------- .../changing-to-oracle-rac.md | 3 +++ .../changing-to-oracle.md | 3 +++ .../changing-to-postgresql.md | 3 +++ 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-ibm-db2.md b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-ibm-db2.md index 96775887ef..a2d43d4795 100644 --- a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-ibm-db2.md +++ b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-ibm-db2.md @@ -14,6 +14,9 @@ The following sections describe how to set up a IBM DB2 database to replace the Follow the instructions below to set up a IBM DB2 database: +!!! important "Character Set and Collation" + IBM DB2 uses **UTF-8 encoding** and **case-sensitive comparison** by default. It is **required** to maintain your DB2 database with case-sensitive comparison to preserve product behaviors. + 1. Create the database using the following command: ```sh $ db2 CREATE DATABASE diff --git a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-mysql.md b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-mysql.md index 39c622c9c9..4b8b0770de 100644 --- a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-mysql.md +++ b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-mysql.md @@ -44,23 +44,29 @@ Follow the instructions below to set up a MySQL database: 1. When prompted, specify the password that will be used to access the databases with the username you specified. -1. In the MySQL command prompt, create the database. +1. In the MySQL command prompt, create the database using a **case-sensitive collation**. - ``` java - create database ; + ```sql + CREATE DATABASE CHARACTER SET latin1 COLLATE latin1_bin; ``` + + !!! warning + When creating the database related to apim_db with MySQL 8.0, add **character set latin1** to avoid the MySQL Linux ERROR 1071 (42000). + ```sql + CREATE DATABASE CHARACTER SET latin1 COLLATE latin1_bin; + ``` - !!! info - Character Sets and Collations in MySQL + !!! info "Character Set in MySQL" - For users of Microsoft Windows, when creating the database in MySQL, it is important to specify the character set as latin1. Failure to do this may result in an error (error code: 1709) when starting your cluster. This error occurs in certain versions of MySQL (5.6.x) and is related to the UTF-8 encoding. MySQL originally used the latin1 character set by default, which stored characters in a 2-byte sequence. However, in recent versions, MySQL defaults to UTF-8 to be friendlier to international users. Hence, you must use latin1 as the character set as indicated below in the database creation commands to avoid this problem. Note that this may result in issues with non-latin characters (like Hebrew, Japanese, etc.). The following is how your database creation command should look. ```sh - create database character set latin1; + CREATE DATABASE CHARACTER SET latin1 COLLATE latin1_bin; ``` - - If you are using MySQL to configure your datasource, we recommend that you use a case sensitive database collation. For more information, see the [MySQL Official Manual](https://dev.mysql.com/doc/refman/5.7/en/charset-mysql.html). The default database collation, which is `latin1_swedish_ci`, is case insensitive. However, you need to maintain case sensitivity for database collation, because when the database or table has a case-insensitive collation in MySQL 5.6 or 5.7, if a user creates an API with letters using mixed case, deletes the API, and then creates another API with the same name, but in lower case letters, then the later created API loses its permission information because when deleting the API, it keeps the Registry collection left behind. - - - This issue could be avoided if you use a case sensitive collation for database and tables. In that case, when creating the second API (which has the same name, but is entirely in lowercase letters), it will create a new record with the lowercase name in the `UM_PERMISSION` table. + !!! important "Case-Sensitive Collation Requirement" + WSO2 API Manager **requires** a case-sensitive database collation. The default collation in MySQL is **case insensitive** and **must not** be used. Using a case-insensitive collation can lead to data integrity issues. + + For **fresh setups**, it is mandatory to use a **case-sensitive collation** such as `latin1_bin`. 1. Provide authorization to the user that you use to access the databases. diff --git a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle-rac.md b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle-rac.md index d370bf0128..9aa4e1ef0d 100644 --- a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle-rac.md +++ b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle-rac.md @@ -16,6 +16,9 @@ Oracle Real Application Clusters (RAC) is an option that facilitates clustering Follow the instructions below to set up an Oracle RAC database: +!!! important "Case Sensitivity" + Oracle RAC databases use **case-sensitive comparison** by default. It is **required** to maintain your Oracle RAC database with case-sensitive comparison to preserve product behaviors. + 1. As SYSDBA, create a database user and grant privileges to the user as shown below: ```sh diff --git a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle.md b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle.md index 682c1fe12f..1d8bd4657a 100644 --- a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle.md +++ b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-oracle.md @@ -14,6 +14,9 @@ The following sections describe how to set up Oracle database to replace the def Follow the instructions below to set up an Oracle database. +!!! important "Case Sensitivity" + Oracle databases use **case-sensitive comparison** by default. It is **required** to maintain your Oracle database with case-sensitive comparison to preserve product behaviors. + 1. As SYSDBA, create a database user and grant privileges to the user as shown below: ```sh diff --git a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-postgresql.md b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-postgresql.md index 686c3828a0..0ccfffd211 100644 --- a/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-postgresql.md +++ b/en/docs/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-postgresql.md @@ -14,6 +14,9 @@ The following sections describe how to set up PostgreSQL database to replace the Follow the instructions below to set up the PostgreSQL database and users. +!!! important "Case Sensitivity" + PostgreSQL databases use **case-sensitive comparison** by default. It is **required** to maintain your PostgreSQL database with case-sensitive comparison to preserve product behaviors. + 1. Login to PostgreSQL using a client (e.g. `psql`). Enter the following command in a command prompt, where `USER_NAME` is the username that you will use to access the databases and `POSTGRE_HOST_IP` is the IP of the host of PostgreSQL server. ```sh