9.4.3 Password specification rules
The password specification rules are as follows:
-
Characters that can be used for passwords are single-byte uppercase letters, single-byte lowercase letters, single-byte numbers, the backslash (\), and the following single-byte characters:
@ ` ! " # $ % & ' ( ) * : + ; [ ] { } , = < > | - . ^ ~ / ? _
-
If you are using a JDBC driver, we recommend that you do not use the following single-byte character in a password:
&
-
If you are using an ODBC driver, we recommend that you do not use the following single-byte characters in a password:
[ ] { } ( ) , ; ? * = ! @
-
A password is specified in the character string literal format. Therefore, you need to enclose the password in single quotation marks (').
Example: When specifying Password01 for a password
IDENTIFIED BY 'Password01'
-
When the password character string includes a single quotation mark ('), you need to specify two single quotation marks to indicate one single quotation mark.
Example: When specifying Pass'01 for a password
IDENTIFIED BY 'Pass''01'
-
A blank character cannot be specified in a password. (The following specification is invalid:)
Example: IDENTIFIED BY ''
-
You can specify a maximum of 255 characters (255 bytes) in a password.
-
For details about the password specification format (details about the character string literal specification format), see Description format of literals in Literals under SQL Basics in the manual HADB SQL Reference.
- ■ Rules for specifying a password in the -p option of a command
-
The following rules apply when you specify a password in the -p option of a command:
-
When a password contains a special character used by the shell for a different purpose
The backslash (\) and vertical bar (|) are examples of special characters used by the shell for different purposes. When a password contains one of these special characters, specify an escape character before the special character.
Examples:
• When specifying Password\01 for a password: -p Password\\01
• When specifying Password|01 for a password: -p Password\|01
In the above examples, the backslash (\) is specified as an escape character.
-