modify-database-hosts

Adds or removes an allowed MySQL host for some or all domains This command can change the remote hosts that are allowed to login to the MySQL/MariaDB databases owned by some virtual servers and all their sub-servers. The domains to modify are selected with the --domain flag, or you can select all (with MySQL/MariaDB enabled) with the --all-domains command-line parameter. The --type flag must be given, and followed by a database type to modify. Currently, only mysql databases support configuration of allowed remote hosts.

Adds or removes an allowed MySQL host for some or all domains#

This command can change the remote hosts that are allowed to login to the MySQL/MariaDB databases owned by some virtual servers and all their sub-servers. The domains to modify are selected with the --domain flag, or you can select all (with MySQL/MariaDB enabled) with the --all-domains command-line parameter. The --type flag must be given, and followed by a database type to modify. Currently, only mysql databases support configuration of allowed remote hosts.

To add a remote system to allowed list, use the --add-host flag followed by a hostname, IP address or IP pattern like 192.168.1.%. To take away a host, use --remove-host. To clear all existing remote hosts and specify a new list, use --set-host. All of these flags may appear multiple times, but if you use --set-host the other two cannot be used.

Access from the system running Virtualmin is always granted, and cannot be removed.

Command line help#

virtualmin modify-database-hosts --domain name | --all-domains
 --type mysql|postgres
 [--add-host ip]
 [--remove-host ip]
 [--set-host ip]

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

  • virtualmin, domain, database, mysql, mariadb, log, command line, modify, hosts
  • 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...