database-server.exe: Database Servers

The database-server.exe utility is designed to manage database servers. The utility allows performing the following tasks:

  • adding and removing database servers to Plesk
  • changing database servers properties and connection settings
  • changing password of the database server administrator
  • setting default database server of a particular database type

 

Location

%plesk_cli%

 

Usage
database-server.exe <command> [<host[:port]>] [
<option 1> <param> [<option 2> <param>] ... [<option N> <param>]
]

 

Example

The following command sets new password newpass for administrator with the login dbadmin on the remote Microsoft SQL database server mssqlserver available at 192.0.2.44.

plesk bin database-server.exe --update-server 192.0.2.16:3838 -type mssql -admin dbadmin -reset-passwd newpass

 

Commands
Command Parameter Description Example

--create-server

<host[:port]>

Adds a database server record to Plesk.

Requires -type, -admin, -passwd options.

To create the MySQL database server available at 192.0.2.33, with database server administrator's login admin and password setup:

plesk bin database-server.exe --create-server 192.0.2.33 -type mysql -admin admin -passwd setup

--update-server

<host[:port]>

Changes configuration settings for the specified database server in Plesk.

To set password for administrator of a remote MySQL server available at 192.0.2.16:3838 to newdbapass:

plesk bin database-server.exe --update-server 192.0.2.16:3838 -reset-passwd newdbapass

--remove-server

<host[:port]>

Removes a database server record from Plesk.

To remove the MySQL database server available at 192.0.2.33:

plesk bin database-server.exe --remove-server 192.0.2.33

--set-default-server

<host[:port]>

Makes a database server primary among servers of the same type, meaning that if in Plesk a database is created for a domain, it is created on this, default DB server.

To set the MySQL database server available at 192.0.2.33 as default for newly created MySQL databases:

plesk bin database-server.exe --set-default-server 192.0.2.33

--set-default-server-local

 

Assigns a local database server as the default server for the database type.

Requires -type option.

To set the local MySQL server as the default server for MySQL databases:

plesk bin database-server.exe --set-default-server-local -type mysql

--list or -l

 

Displays the list of database servers registered in Plesk.

To see the list of database servers registered in Plesk:

plesk bin database-server.exe --list

--xml-info or -xi

 

Displays the list of database servers registered in Plesk in the XML format.

To see the list of database servers registered in Plesk in the XML format:

plesk bin database-server.exe --xml-info

--help or -h

 

Displays help on the use of the utility.

plesk bin database-server.exe --help

or

plesk bin database-server.exe -h

 

Options
Option Parameter Description Example

-type

mysql|mssql

Specifies a type of a database server.

Used only with the --create-server.

Required with --create-server.

To create the MySQL database server available at 192.0.2.33, with database server administrator's login admin and password setup:

plesk bin database-server.exe --create-server 192.0.2.33 -type mysql -admin admin -passwd setup

-set

<host>:<port>

Specifies a database server host, port number, or a combination of the parameters.

To change the port on which the local MySQL database server listens to from default 3306 to 22222:

plesk bin database-server.exe --update-server localhost:3306 -set 22308

-admin

<login_name>

Specifies a database server administrator's login name.

Required with --create-server.

To create the MySQL database server available at 192.0.2.33, with database server administrator's login admin and password setup:

plesk bin database-server.exe --create-server 192.0.2.33 -type mysql -admin admin -passwd setup

-passwd

<password>

Specifies database server administrator's password.

Used only with --create-server.

Required with --create-server.

To create MySQL database server available at 192.0.2.33, with database server administrator's login admin and password setup:

plesk bin database-server.exe --create-server 192.0.2.33 -type mysql -admin admin -passwd setup

-reset-passwd

<password>

Changes password of the database server administrator.

To change administrator's password to 123456 for the local Microsoft SQL Database server:

plesk bin database-server.exe --update-server localhost -type mssql -reset-passwd 123456

-db-server-temp-backup-dir

 

The path to a physical folder on the remote server where the MS SQL server is located. The MS SQL server must be able to access this folder for reading and writing temporary backup files.

To set up database server backups:

plesk bin database-server.exe -db-server-temp-backup-dir "C:\DirectoryPath" -db-server-network-backup-dir "\ServerName\DirectoryPath" -db-server-network-backup-usr backupuser -db-server-network-backup-pwd 1qazXSW@

-db-server-network-backup-dir

 

The path to the network share of the folder specified above. The network share should be mapped to that physical folder. Plesk will access the shared folder to download and upload backup files.

-db-server-network-backup-usr

<login>

The username of a network user created on the remote server. For example, ServerName\UserName. The user must have access to the shared folder specified above.

-db-server-network-backup-pwd

<passwd>

The network user's password.

 

 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.