• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Question Create Database with PHP Script

Marcio Nunes

Basic Pleskian
Hi,
My customer need create database in PHP. He need many little databases dynamics

I created user in your subscription and set permission in mysql database table users to Create_priv (Y) and working, but, the database created dont show in plesk subscription.

How create a database and list in yours databases in Plesk. Missing a link to subscritor with table?

If dont show in Plesk, he dont can manager this databases, I dont share root passwords with customers
 
My test Work fine:
After create a database, I run this insert in data_base table (PSA database) (permission needed=priv_update)

INSERT INTO psa.`data_bases` (`id`, `name`, `type`, `dom_id`, `db_server_id`, `default_user_id`, `external_id`) VALUES (NULL, 'databasename', 'mysql', '1', '1', NULL, NULL)

Is ok? Is a risk of strucure Plesk?
 
In addition to the XML-RCP API suggested by Igor you can also use the REST API to create and manage databases. Which is a bit easier to work with. I any case, DO NOT directly edit the PSA database. It's a security risk and you may run into compatibility issues.
 
Back
Top