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

Install error - SS2.4.2 / MySQL 4.1 / Yahoo hosting


Go to End


10 Posts   4602 Views

Avatar
ramshackle

Community Member, 22 Posts

6 October 2010 at 3:41pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

6 October 2010 at 8:19pm

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.

Avatar
ramshackle

Community Member, 22 Posts

6 October 2010 at 9:55pm

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

Avatar
Sean

Forum Moderator, 922 Posts

7 October 2010 at 12:46am

Edited: 07/10/2010 1:06am

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

Avatar
ramshackle

Community Member, 22 Posts

7 October 2010 at 9:46am

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

Avatar
Sean

Forum Moderator, 922 Posts

8 October 2010 at 11:47am

Edited: 08/10/2010 11:49am

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

Avatar
ramshackle

Community Member, 22 Posts

9 October 2010 at 3:52pm

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

Avatar
Sean

Forum Moderator, 922 Posts

9 October 2010 at 8:26pm

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

Go to Top