create-database

Creates a database for a virtual server This command creates a new MySQL/MariaDB or PostgreSQL database, and associates it with an existing virtual server. You must supply the --domain parameter to specify the server, --name to set the database name, and --type followed by either mysql, postgres or some plugin database type. It would typically be run something like: create-database.pl --domain foo.com --name foo_phpbb --type mysql Some database types support additional creation-time options, specified using the --opt flag. At the time of writing, those available for MySQL/MariaDB are:

Creates a database for a virtual server#

This command creates a new MySQL/MariaDB or PostgreSQL database, and associates it with an existing virtual server. You must supply the --domain parameter to specify the server, --name to set the database name, and --type followed by either mysql, postgres or some plugin database type. It would typically be run something like:

create-database.pl --domain foo.com --name foo_phpbb --type mysql

Some database types support additional creation-time options, specified using the --opt flag. At the time of writing, those available for MySQL/MariaDB are:

--opt charset name - Sets the character set (like latin2 or euc-jp) for the new database.

And for PostgreSQL, the options are:

--opt encoding name - Sets the text encoding (like LATIN2 or EUC_JP) for the new database.

Command line help#

virtualmin create-database --domain domain.name
 --name database-name
 --type mysql|postgres
 [--opt "name value"]*

Source: https://www.virtualmin.com/docs/development/api-programs/create-database/

  • virtualmin, php, domain, database, mysql, mariadb, postgresql, command line, create
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Pre and Post Domain Modification Scripts

Virtualmin allows the use of custom scripts (Shell, Perl, Python and etc.) to automate tasks...

OS Support

Virtualmin runs on top of Webmin. Webmin works on almost every UNIX-like OS, so with some manual...

Professional Features

Virtualmin GPL is already an extremely powerful and flexible virtual hosting control panel, so...

How to Configure Secondary DNS

This guide provides administrators with a quick overview of setting up automatic DNS secondary...

How to Configure Cloudflare DNS

For users looking to integrate Cloudflare with Virtualmin Pro, the process is straightforward and...