When using Installatron Server via API, databases must be created prior to invoking the API (using whatever method is available to users on your server).
NOTE: When manually creating a database it's important to remember to give the database-user full privileged access to the database. This is not always the default privilege access level.
When using Installatron Server via GUI, there are two ways to handle database creation:
The preferred solution is to implement a PHP class (described in detail below) that Installatron Server then uses to list, create, and delete databases.
Using this solution's default configuration, this will create a new database for each application that Installatron Server installs.
The simpler solution is to keep the API model's approach to database management: requiring pre-created databases.
Installatron can be informed of externally created databases using the POST /users/{id} API, and the user will then have them available, to use as the application's database, when they install an application from the GUI.
A warning: users are able to choose databases that already have applications using them (ie. database sharing). Most applications installed by Installatron support database sharing through the use of table prefixes, however there are applications (eg. SugarCRM, Tiki Wiki) that don't support table prefixes so installing those applications into a database that already contains an application that doesn't use a table prefix is likely to cause table collisions. This is why option 1 is the preferred database creation solution.
But if you need to use this method, option 2, then we recommend disabling any applications that don't support table prefixes to avoid long term problems.
To use solution 1, implement these PHP methods:
-in this file:
Here is an example implementation of these methods in panel.php, to get you started:
With those methods performing their required tasks and returning the required information, Installatron Server is able to fully automate database handling on your server.
Don't hesitate to contact Installatron Support if you have questions.