1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

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

Discussion in 'Plesk for Windows - 8.x and Older' started by netors, Jul 9, 2007.

  1. netors

    netors Guest

    0
     
    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!
     
  2. Bogdan

    Bogdan Guest

    0
     
    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.
     
  3. Bogdan

    Bogdan Guest

    0
     
Loading...