The database-server utility is used to manage database server entries in Plesk through CLI. By using this utility, you can perform the following tasks:
Syntax
database-server <command> [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line sets the new login name newdbadmin and the new password newdbadminpass for the database server administrator on a remote database server previously available at 192.168.67.78:3838 (as recorded in the database server entry in Plesk) and sets the IP address and port number for the entry to 192.168.78.89:3636.
# ./database-server --update-server 192.168.72.16:67.78 -set 192.168.78.89:3636 -admin newdbadmin -passwd newdbadminpass
Commands
5Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Creates a database server entry in Plesk. Requires concomitant use of the |
To create a database server entry in Plesk for a MySQL server available at IP address and port number 192.168.67.78:3838 and set the server administrator's login name dbadmin and password dbadminpass: # ./database-server --create-server 192.168.67.78:3838 -type mysql -admin dbadmin -passwd dbadminpass |
|
|
Updates database server connection settings - type, host address, port number - in the database server entry in Plesk. The database server entry must exist in Plesk before executing this command. The changes made by this command may adversely affect performance of site applications and user scripts. Cannot be used to change the local MySQL database server entry settings. |
To change the database server administrator's login name to newdbadmin and password to newdbadminpass on the remote MySQL server available at IP address and port number 192.168.67.78:3838: # ./database-server --update-server 192.168.67.78:3838 -admin newdbadmin -passwd newdbadminpass |
|
|
Deletes a database server entry from Plesk. Only remote database servers that has no hosted databases on it can be deleted from Plesk. A default database server cannot be deleted. |
To remove the database server entry from Plesk for the database server available at IP address and port number 192.168.67.78:3838: # ./database-server --remove-server 192.168.67.78:3838 |
|
|
Assigns a remote database server entry as the default server for the database type. Only remote database servers can be set as default servers by using this command. |
To set the database server server available at IP address and port number 192.168.67.78:3838 for databases of its type: # ./database-server --set-default-server 192.168.67.78:3838
|
|
|
Assigns a local database server as the default server for the database type. Requires concomitant use of the |
To set the local MySQL server as the default server for MySQL databases: # ./database-server --set-default-server-local -type mysql |
|
|
Displays help on the use of the utility. |
To view help on the use of the utility: # ./database-server --help or # ./database-server -h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies the database server host and port number. Used only with the |
To change the IP address and port number to 192.168.78.89:3636 for the remote database server previously available at 192.168.72.16:3838 as recorded in the database server entry in Plesk: # ./database-server --update-server 192.168.72.16:3838 -type mysql -set 192.168.78.89:3636
|
|
|
Specifies the type of a database server. Used with |
To create a database server entry in Plesk for a MySQL server available at 192.168.67.78:3838 and set the server administrator's login name dbadmin and password dbadminpass: # ./database-server --create-server 192.168.67.78:3838 -type mysql -admin dbadmin -passwd dbadminpass |
|
|
Specifies database server administrator's login name. Used with the |
|
|
|
Specifies database server administrator's password. Used with the For additional comments, see the Note below the table. |
Note: Use of this option is not recommended. Passing passwords through CLI as parameters of the -passwd option may potentially compromise the system's security as command line can be observed by other users of the system. It is more secure to pass passwords through the environment variables. You can transfer non-encrypted passwords by using environment variable PSA_PASSWORD while using single quotes to specify the empty values in the command line for the argument of the -passwd - -passwd_type options.