• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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