Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Installing Silverstripe Database


Reply


8 Posts   2793 Views

Avatar
steve_nyhof

Community Member, 224 Posts

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?

Avatar
Sean

Forum Moderator, 922 Posts

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.

Sean

Avatar
steve_nyhof

Community Member, 224 Posts

19 July 2010 at 9:53am

Edited: 19/07/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?

Thank you,
Steve

Avatar
Sean

Forum Moderator, 922 Posts

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.

Sean

Avatar
TotalNet

Community Member, 181 Posts

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.

Avatar
steve_nyhof

Community Member, 224 Posts

19 July 2010 at 11:44am

Edited: 19/07/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?

Avatar
TotalNet

Community Member, 181 Posts

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.

Avatar
steve_nyhof

Community Member, 224 Posts

19 July 2010 at 12:23pm

Edited: 19/07/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
Steve