-A, --auth=METHOD | Specifies the authentication method for local users used in pg_hba.conf (host and local rows). Do not use trust, which is the default value, unless you trust all local users on your system. | Values of METHOD: - trust
- reject
- md5 (an insecure algorithm, used for compatibility with earlier versions)
- sha256
- sm3
Default value: trust |
--auth-host=METHOD | Specifies the authentication method for local users via TCP/IP connections used in pg_hba.conf (host rows). The value specified in the -A parameter is overwritten when this parameter is specified. | Values of METHOD: - trust
- reject
- md5 (an insecure algorithm, used for compatibility with earlier versions)
- sha256
- sm3
Default value: trust |
--auth-local=METHOD | Specifies the authentication method for local users via Unix-domain socket connections used in pg_hba.conf (local rows). The value specified in the -A parameter is overwritten when this parameter is specified. | Values of METHOD: - trust
- reject
- md5 (an insecure algorithm, used for compatibility with earlier versions)
- sha256
- sm3
- peer (only for the local mode)
Default value: trust |
-c, --enable-dcf | Sets the node to be installed to the DCF mode. NOTE:In the Lite scenario, this parameter is provided by openGauss, but the DCF function is unavailable. openGauss provides master node selection when DCF is available. You can configure DCF-related parameters. | - |
[-D, --pgdata=]DATADIR | Specifies the data directory. | Set DATADIR as needed. The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
--nodename=NODENAME | Specifies the name of the node to be initialized. | The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
-E, --encoding=ENCODING | Sets the encoding format for the new database. | - If this parameter is specified, you also need to add the --locale option to specify the locale that supports this encoding format. If the --locale option is not added, the system default locale is used. If the encoding format in the system default locale is inconsistent with the encoding format specified in this parameter, the database initialization fails.
- If this parameter is not specified, the encoding format of the default locale is used. You can run the locale command to view the default locale and its encoding format:
omm@linux:~> locale|grep LC_CTYPE
LC_CTYPE="en_US.UTF-8"
In the command output, UTF-8 indicates the encoding format of the default locale. The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!".
|
--locale=LOCALE | Sets the default locale for the new database. NOTICE:If you have set the database encoding format, ensure that the locale you select has the same encoding format as the preset one. Otherwise, the database initialization fails. | For example, to set the database encoding format to GBK, perform the following steps: - Run the locale -a |grep gbk command to query the locales that support GBK:
omm@linux:~> locale -a|grep gbk
zh_CN.gbk
zh_SG.gbk
- Add the --locale=zh_CN.gbk option when initializing the database.
- The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!".
|
--dbcompatibility=DBCOMPATIBILITY | Sets the default compatibility for the new database. | The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
--lc-collate=LOCALE --lc-ctype=LOCALE --lc-messages=LOCALE --lc-monetary=LOCALE --lc-numeric=LOCALE --lc-time=LOCALE | Sets the locale in the specified category for the new database. | The parameter values must be supported by the OS. The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". NOTE:If the --lc-collate parameter is not specified when the database is installed, the default value of --lc-collate is C. |
--no-locale | Equivalent to --locale=C. | - |
--pwfile=FILE | Reads the password of the database sysadmin from FILE during the running of gs_initdb. The first line of the file is taken as the password. | The format of FILE can be "a relative path+file" or "an absolute path+file". The relative path is relative to the current path. The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
-T, --text-search-config=CFG | Sets the default text search mode. | Values of text-search-config: - pg_catalog.english: full-context search
- pg_catalog.simple: common text search
Default value: pg_catalog.simple |
-U, --username=NAME | Selects the username of the database sysadmin. | Value range: normal database users The value cannot contain "|", ";", "&", "<", ">", "`", "\\", or "!". Default value: OS user who runs gs_initdb |
-W, --pwprompt | Prompts users to enter the password of the database administrator during the running of gs_initdb. | - |
-w, --pwpasswd=PASSWD | Specifies the password of the database administrator by running commands during the running of gs_initdb instead of interactive input. | The password must meet the following complexity requirement: - The password must contain at least eight characters.
- Cannot be the same as the username, the current password (ALTER), or the current password in an inverted sequence.
- Contains at least three types of the following characters:
- Uppercase letters (A-Z)
- Lowercase letters (a-z)
- Digits: 0–9
- Special characters: ~!@#$%^&*()-_=+\|[{}];:,<.>/?
|
-C, --enpwdfiledir=DIR | Specifies the directory where the password encrypted is located, using the AES128 encryption algorithm during the running of gs_initdb. gs_initdb decrypts the password file in this directory and performs the password complexity check on the decrypted password. The password is used as the user's password if the verification result is passed. NOTE:- Run the gs_guc encrypt -K password -D Dir command to generate the encrypted password file.
- If multiple -w and -C parameters are specified, gs_initdb regards the last -w or -C parameter as the user's requirement (entering a plaintext password or a password encrypted using AES128).
| The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
-X, --xlogdir=XLOGDIR | Specifies the directory where the transaction logs are stored. The directory must be a directory for which openGauss users have the read and write permissions. | The value can be an absolute path or a relative path. The relative path is relative to the data directory. The value cannot contain "|", ";", "&", "$", "<", ">", "`", "\\", or "!". |
-S, --security | This database is initialized in the security mode. | After the database is initialized using -S, the created database user permissions are restricted, and the public schema permission cannot be used any more by default. |