PLESK COMMAND LINE INTERFACE

Section 3.2.3 Managing Databases

3.2.3.1. Purpose

The database.sh utility may be used for creating/updating/removing databases under control of Plesk Server Administrator, and for managing database users.

3.2.3.2 Usage

Usage: database.sh command [options]

Available commands and options:

Command Parameter Action
--create or -c <db_name> creates a database
--update or -u <db_name> updates a database: adds, edits, removes a db user
--remove or -r <db_name> deletes a database
--help or -h   displays help on the utility usage
Option Parameter Note
-domain <domain_name> domain name (required for creation)
-type   type of a database
-passwd <passwd> sets user password
-passwd_type <plain|crypt> sets user password type (only for MySQL)
-add_user <login_name> adds the user with the specified name
-update_user <login_name> updates the user with the specified name
-remove_user <login_name> removes the user with the specified name
-user_name <login_name> sets login name (may be set/specified with the "update_user" option)

3.2.3.3 Examples

Creating a MySQL database:
./database.sh --create "database1" -domain "domain.zone" -type mysql

Adding a user to the MySQL database:
./database.sh --update "database1" -add_user "db1user" -passwd "password"

to top