Jump to:

4873 Posts in 7242 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » CREATE TABLE installation mysql error

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

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

Page: 1
Go to End
Author Topic: 853 Views
  • J!
    Avatar
    Community Member
    1 Post

    CREATE TABLE installation mysql error Link to this post

    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
  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: CREATE TABLE installation mysql error Link to this post

    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/

  • martimiz
    Avatar
    Forum Moderator
    1038 Posts

    Re: CREATE TABLE installation mysql error Link to this post

    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...

    853 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.