Jump to:

4952 Posts in 14081 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting

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

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

Page: 1 2
Go to End
Author Topic: 2501 Views
  • ramshackle
    Avatar
    Community Member
    22 Posts

    Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Hi there,

    Trying to install SS2.4.2 with MySQL 4.1 on Yahoo! hosting, not a great combo I know! But in a bit of a rush.

    Get the following error after hitting the install button (all initial checks on the install screen are fine apart from the "MySQL 5 recommended" line):

    Setting up 'mysite/_config.php'...
    Setting up //mysite/_config.php
    Building database schema...

    [User Error] Couldn't run query: CREATE TABLE "PageComment" ( "ID" int(11) not null auto_increment, "ClassName" enum('PageComment') character set utf8 collate utf8_general_ci default 'PageComment', "Created" datetime, "LastEdited" datetime, "Name" varchar(200) character set utf8 collate utf8_general_ci, "Comment" mediumtext character set utf8 collate utf8_general_ci, "IsSpam" tinyint(1) unsigned not null default 0, "NeedsModeration" tinyint(1) unsigned not null default 0, "CommenterURL" varchar(255) character set utf8 collate utf8_general_ci, "SessionID" varchar(255) character set utf8 collate utf8_general_ci, "ParentID" int(11) not null default 0, "AuthorID" int(11) not null default 0, index "ParentID" (ParentID), index "AuthorID" (AuthorID), index "ClassName" (ClassName), primary key (ID) ) ENGINE=MyISAM Access denied for user 'riverq'@'localhost' to database 'mysql'
    POST /install.php

    Looks like an access problem from the last line there, although I am definitely using the correct db admin user and password (checks out ok on the first install screen).

    The Yahoo! documentation has the following info on accessing the MySQL db:
    "Please note that you can access your database using either PHP or Perl scripts run from your web site or the phpMyAdmin database management tool. You can create custom scripts or install publicly available packages that use a MySQL database, such as our advanced add-ons. You will not be able to access your database using a desktop client or other tools run outside of Yahoo!"

    So wondering if this is a MySQL 4.1 issue or Yahoo! hosting issue. Question is, how does SS run SQL queries on install - through a php script? If so should be fine. As you can probably tell I'm pretty new to web development.

    If anyone has any ideas, that would be very much appreciated. Don't fancy my chances of a quick response from Yahoo.

    Cheers

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Well the error message "Access denied for user 'riverq'@'localhost' to database 'mysql' " would suggest that you don't have permission as riverq to the mysql database. Also check that Yahoo hosting doesn't use another server other than localhost.

  • ramshackle
    Avatar
    Community Member
    22 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Thanks Will,

    Yes the server on Yahoo is Mysql (they like that name - it's the enforced db name too) not localhost, I specified this on install and it's specified in mysite/_config.php - not sure why the error message is saying user 'riverq'@'localhost' - is there anywhere else to specify the local server name for running scripts?

    Cheers

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Keep in mind that MySQL 4.1 is no longer supported by SilverStripe. This version of the database is extremely old.
    I'm surprised Yahoo are still going with that. Hopefully they upgrade soon!

    Could you paste in your mysite/_config.php file so we can see how it's configured?

    Cheers,
    Sean

  • ramshackle
    Avatar
    Community Member
    22 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Here it is Sean :

    <?php

    global $project;
    $project = 'mysite';

    global $databaseConfig;
    $databaseConfig = array(
       "type" => 'MySQLDatabase',
       "server" => 'mysql',
       "username" => 'riverq',
       "password" => '****',
       "database" => 'mysql',
       "path" => '',
    );

    MySQLDatabase::set_connection_charset('utf8');

    // This line set's the current theme. More themes can be
    // downloaded from http://www.silverstripe.org/themes/
    SSViewer::set_theme('blackcandy');

    // Set the site locale
    i18n::set_locale('en_US');

    // enable nested URLs for this site (e.g. page/sub-page/)
    SiteTree::enable_nested_urls();

    Yep I saw that MySQL 4.1 isn't supported, Yahoo haven't upgraded yet - hosting not one of their fortes.

    Cheers

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    This looks correct. It's a bit strange the database server is called "mysql", but if that's what it is, then I don't see why it was trying localhost.

    When you got the error "Access denied for user 'riverq'@'localhost' to database 'mysql'" was there any backtrace of code execution below this error? I'd like to see where it is setting the database parameters before running these queries.

    Cheers,
    Sean

  • ramshackle
    Avatar
    Community Member
    22 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Here's the trace Sean - cheers for looking at this. I'm a bit lost - just seems that when it hits the 'create table' query it's using localhost as the server, no obvious reason why - could be a Yahoo quirk, weird though as they don't use localhost.

    Line 536 in /sapphire/core/model/MySQLDatabase.php

    Source

    527    }
    528    
    529    function databaseError($msg, $errorLevel = E_USER_ERROR) {
    530       // try to extract and format query
    531       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
    532          $formatter = new SQLFormatter();
    533          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
    534       }
    535       
    536       user_error($msg, $errorLevel);
    537    }
    538    
    539    /**
    540     * Return a boolean type-formatted string
    541     *
    542     * @param array $values Contains a tokenised list of info about this data type

    Trace

    * Couldn't run query: CREATE TABLE "PageComment" ( "ID" int(11) not null auto_increment, "ClassName" enum('PageComment') character set utf8 collate utf8_general_ci default 'PageComment', "Created" datetime, "LastEdited" datetime, "Name" varchar(200) character set utf8 collate utf8_general_ci, "Comment" mediumtext character set utf8 collate utf8_general_ci, "IsSpam" tinyint(1) unsigned not null default 0, "NeedsModeration" tinyint(1) unsigned not null default 0, "CommenterURL" varchar(255) character set utf8 collate utf8_general_ci, "SessionID" varchar(255) character set utf8 collate utf8_general_ci, "ParentID" int(11) not null default 0, "AuthorID" int(11) not null default 0, index "ParentID" (ParentID), index "AuthorID" (AuthorID), index "ClassName" (ClassName), primary key (ID) ) ENGINE=MyISAM Access denied for user 'riverq'@'localhost' to database 'mysql'
    Line 536 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: CREATE TABLE "PageComment" ( "ID" int(11) not null auto_increment, "ClassName" enum('PageComment') character set utf8 collate utf8_general_ci default 'PageComment', "Created" datetime, "LastEdited" datetime, "Name" varchar(200) character set utf8 collate utf8_general_ci, "Comment" mediumtext character set utf8 collate utf8_general_ci, "IsSpam" tinyint(1) unsigned not null default 0, "NeedsModeration" tinyint(1) unsigned not null default 0, "CommenterURL" varchar(255) character set utf8 collate utf8_general_ci, "SessionID" varchar(255) character set utf8 collate utf8_general_ci, "ParentID" int(11) not null default 0, "AuthorID" int(11) not null default 0, index "ParentID" (ParentID), index "AuthorID" (AuthorID), index "ClassName" (ClassName), primary key (ID) ) ENGINE=MyISAM | Access denied for user 'riverq'@'localhost' to database 'mysql',256)
    Line 134 of MySQLDatabase.php
    * MySQLDatabase->query(CREATE TABLE "PageComment" ( "ID" int(11) not null auto_increment, "ClassName" enum('PageComment') character set utf8 collate utf8_general_ci default 'PageComment', "Created" datetime, "LastEdited" datetime, "Name" varchar(200) character set utf8 collate utf8_general_ci, "Comment" mediumtext character set utf8 collate utf8_general_ci, "IsSpam" tinyint(1) unsigned not null default 0, "NeedsModeration" tinyint(1) unsigned not null default 0, "CommenterURL" varchar(255) character set utf8 collate utf8_general_ci, "SessionID" varchar(255) character set utf8 collate utf8_general_ci, "ParentID" int(11) not null default 0, "AuthorID" int(11) not null default 0, index "ParentID" (ParentID), index "AuthorID" (AuthorID), index "ClassName" (ClassName), primary key (ID) ) ENGINE=MyISAM)
    Line 234 of MySQLDatabase.php
    * MySQLDatabase->createTable(PageComment,Array,Array,Array,)
    Line 181 of Database.php
    * SS_Database->endSchemaUpdate()
    Line 213 of DatabaseAdmin.php
    * DatabaseAdmin->doBuild(1)
    Line 1056 of install.php
    * Installer->install(Array)
    Line 201 of install.php

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting Link to this post

    Are you using an _ss_environment file by chance? If so, remove this before trying the installer.

    In install.php you could try adding a line to force the server parameter. Look around line 201 and do something like this:

    $databaseConfig['server'] = 'mysql'; // force the database server parameter

    $inst = new Installer();
    if($_REQUEST) $inst->install($_REQUEST);
    else $inst->install(array(
       'db' => $databaseConfig,
       'admin' => $adminConfig,
    ));

    Does this produce the same error if you try installing again?

    Cheers,
    Sean

    2501 Views
Page: 1 2
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.