Is it possible to have silverstripe add the database from the install?
In other words, without setting up the mysql database first, can silverstripe add and setup the mysql database from the SS install?
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Is it possible to have silverstripe add the database from the install?
In other words, without setting up the mysql database first, can silverstripe add and setup the mysql database from the SS install?
Yes, it already creates the database automatically providing the database credentials you provide have access to add the database.
Sean
Could you expound on that a bit?
If a db does not exist in cPanel - silverstripe can create one from the install?
When I enter the details into the install form fields, what exactly would have to be "in place" to make this work?
Thank you,
Steve
If SilverStripe can create the database it will, just type a database name into the configuration details in the installer.
If it can't create one, there'll be an error, but only in the event that it doesn't have permission to do so. If it all went fine and was able to create a database, then there won't be any error.
Sean
Specifically, the user credentials you provide for connecting to the database in _config.php must have "create database" privileges on the database server.
I have a support ticket into my host. I have a server with cPanel (WHM) and have looked for what I might need to be setup. But you are also saying that I need to setup "create database" privileges on the database server. Can you show me the line (of code) in the _config.php file that you enter to make this work?
It's not quite as involved as that.
in _config.php you set up your database connection, assuming you are using MySQL it will look something like:
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => "localhost",
"username" => "mydbuser",
"password" => "password",
"database" => "mysite",
);
You don't change anything here, however, "mydbuser" needs to be allowed to create a database on your MySQL server.
Unless you are are setting up many different CMS installations it's probably easier (and more secure) to create a database manually, if you are setting up several then you'd be better off writing your own installation script and not use install.php at all.
Thank you for the info, this is very helpful. I will get this to my programmer. We will be setting up 1000's of sites a year so I want a faster way, and remove what steps I can. Currently it takes about 3-1/2 minutes to setup a site and give access to the user, I want to cut that time down.
Thank you again
Steve