• 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

How does Plesk links a Database to a Domain in Windows registry?

N

netors

Guest
I have PHP scripts that automatically generates MySQL Databases and Users for those databases.

What i want to do, is to be able to create those databases in php but i want them also to be reflected under an specific domain under the Plesk control manager.

I suppose i have to add them in some way to the windows registry in order for the plesk control panel to automatically detect them, but HOW?'

i hope i explained my self. thanks!
 
Plesk keeps all informations regarding the hosted databases and their users in it's configuration psa database. As far as I know, on linux the database needs to be MySQL, but on Windows you can choose between MySQL, MSSQL and MS Access and the MySQL instance is running on port 8306 by default. The tables you're looking for are 'data_bases' and 'db_users' and they're also linked to the 'domains' table, but you'll figure out the rest.

Another option would be to try to run the back-end tool for managing database:
Code:
C:\Documents and Settings\Administrator>cd %plesk_bin%

C:\Program Files\SWsoft\Plesk\admin\bin>database.exe --help

Usage: database.exe command [options]

    Available commands:
    --create or -c     <db_name>       Create database
    --update or -u     <db_name>       Update database: add, edit, remove
                                       database user
    --remove or -r     <db_name>       Delete database
    --help or -h                       displays this help page

    Available options:
    -domain            <domain_name>   Domain name (required for creation)
    -type              <mysql|mssql>   Type of database
    -passwd            <passwd>        Set user password
    -add_user          <login_name>    Add user with given name
    -update_user       <login_name>    Update user with given name
    -remove_user       <login_name>    Remove user with given name
    -user_name         <login_name>    Set login name (may by specified with
                                       "update_user" option)
    -server            <host[:port]>   Specify database server

Version: psa v8.1.1_build20070326.13 os_Windows 5.2.3790.0


C:\Program Files\SWsoft\Plesk\admin\bin>

These are only a few ideas, however if you want to develop an application that will work with future versions of Plesk the best solution is to join the SWsoft Developer Network and try use the Plesk APIs to sync your databases. I'm sure that this is what SWsoft would recommend too.
 
Back
Top