4571 Posts in 1382 Topics by 1376 members
|Go to End|
19 July 2010 at 8:50am
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?
19 July 2010 at 9:24am
Yes, it already creates the database automatically providing the database credentials you provide have access to add the database.
19 July 2010 at 9:53am Last edited: 19 July 2010 9:54am
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?
19 July 2010 at 10:02am
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.
19 July 2010 at 11:24am
Specifically, the user credentials you provide for connecting to the database in _config.php must have "create database" privileges on the database server.
19 July 2010 at 11:44am Last edited: 19 July 2010 11:44am
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?
19 July 2010 at 11:53am
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.
19 July 2010 at 12:23pm Last edited: 19 July 2010 12:24pm
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
|Go to Top|