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.

We've moved the forum!

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.

Installing SilverStripe /

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

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

CREATE TABLE installation mysql error


Go to End


3 Posts   2218 Views

Avatar
J!

Community Member, 1 Post

4 July 2012 at 5:03am

I'm desperately trying to install SS to a Linux server:
Apache 2.0
Php 5.3.3 mod_rewrite and AllowOverride all
MySQL 5.1.52

Both versions (3.0 and 2.4.7) crash at the point where database is being built (same databaseError user_error).

3.0 gives error on building the email bounce table and 2.4.7 gives error at siteconfig_viewergroups" table. All in all I'm sure it is nothing to do with the table itself, but some major configuration.

"Building database schema...

[User Error] Couldn't run query: CREATE TABLE "SiteConfig_ViewerGroups" ( "ID" int(11) not null auto_increment, "SiteConfigID" int(11) not null default 0, "GroupID" int(11) not null default 0, index "SiteConfigID" (SiteConfigID), index "GroupID" (GroupID), primary key (ID) ) ENGINE=MyISAM Table 'SiteConfig_ViewerGroups' already exists
POST /nypli/install.php

Line 525 in /var/www/html/nypli/sapphire/core/model/MySQLDatabase.php

Source
---------------
}
517
518 function databaseError($msg, $errorLevel = E_USER_ERROR) {
519 // try to extract and format query
520 if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
521 $formatter = new SQLFormatter();
522 $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
523 }
524
525 user_error($msg, $errorLevel);
526 }
527
528 /**
529 * Return a boolean type-formatted string
530 *
531 * @param array $values Contains a tokenised list of info about this data type
-----------

Trace
Couldn't run query: CREATE TABLE "SiteConfig_ViewerGroups" ( "ID" int(11) not null auto_increment, "SiteConfigID" int(11) not null default 0, "GroupID" int(11) not null default 0, index "SiteConfigID" (SiteConfigID), index "GroupID" (GroupID), primary key (ID) ) ENGINE=MyISAM Table 'SiteConfig_ViewerGroups' already exists
Line 525 of MySQLDatabase.php"

When this first happened I had the db rebuilt by the administrator due I thought there were some tables already there, but that's not the case.

When I refresh the page SS says that it has been installed. Trying to access any directory dev/build?--- session starts and the same create table user error comes. Trying to access admin panel leads to a selection error, because the installation creates only tables that are being created before the tables giving errors.

ANY IDEA what causes the CREATE TABLE error?

Attached Files
Avatar
bartvanirsel

Community Member, 96 Posts

4 July 2012 at 7:24am

Maybe it has something to do with the myisam storage driver in ss3?

try putting this in _config.php:
DataObject::$create_table_options['MySQLDatabase'] = 'ENGINE=MyISAM';

found it here:

http://doc.silverstripe.org/framework/en/trunk/changelogs/3.0.0/

Avatar
martimiz

Forum Moderator, 1391 Posts

5 July 2012 at 6:50am

As this is happening on both versions of SilverStripe, it might not even be a SilverStripe issue. It could just as well be a MySQL issue, as 'Table 'XXXXX' already exists' might be a MySSQL message.

I would try and execute a simple create statement on that table using a MySQL client, just to make sure this isn't the case - if you have access to that database, that is...