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

Error: C:\inetpub\wwwroot\silverstripe\sapphire\core\model\MySQLDatabase.php:


Reply

3 Posts   3283 Views

Avatar
tom12010

22 March 2009 at 5:20am Community Member, 2 Posts

Tried 3 timesinstalling with WebPI to Windows 7, all the other apps worked, even Drupal.
Double-checked typing, cannot even run http://localhost/silverstripe/install.php...
Was any testing done before this was put up to MS' site?????

[Warning] mysql_connect() [function.mysql-connect]: Access denied for user 'silverstripeuser'@'localhost' (using password: YES)
GET /silverstripe
Line 35 in C:\inetpub\wwwroot\silverstripe\sapphire\core\model\MySQLDatabase.php

Source
26    /**
27     * Connect to a MySQL database.
28     * @param array $parameters An map of parameters, which should include:
29     * - server: The server, eg, localhost
30     * - username: The username to log on with
31     * - password: The password to log on with
32     * - database: The database to connect to
33     */
34    public function __construct($parameters) {
35       $this->dbConn = mysql_connect($parameters['server'], $parameters['username'], $parameters['password']);
36       $this->active = mysql_select_db($parameters['database'], $this->dbConn);
37       $this->database = $parameters['database'];
38       if(!$this->dbConn) {
39          $this->databaseError("Couldn't connect to MySQL database");
40       }
41
Trace
•mysql_connect(localhost,silverstripeuser,********)
Line 35 of MySQLDatabase.php
•MySQLDatabase->__construct(Array)
Line 72 of DB.php
•DB::connect(Array)
Line 109 of main.php

Avatar
tom12010

22 March 2009 at 5:43am Community Member, 2 Posts

FIXED!!

Downloaded mySQL Administrator, gave this database user ALL privileges, set up a connection, started again with http://localhost/silverstripe, then it came up.

Pretty dumb of the WebPI installer not to set up table privileges etc. -- it was equally stupid with Drupal on some things, if that makes y'all feel any better...

Avatar
Oyadioo

12 March 2012 at 4:27am Community Member, 1 Post

I have this same problem...

Everything seems to be right.....it works fine on my local machine and my db user is root...

When i upload and check this online,i get error Line 57 in E:\HostingSpaces\coreglob\core-globalservices.com.ng\wwwroot\testsite

\sapphire\core\model\MySQLDatabase.php.

When i try to connect to phpmyadmin using same username and password used in my connection string,i can connect.

What could the problem be????is it that i do not have any privilege attached to my user????

Please see error below.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

[Warning] mysql_connect(): Access denied for user 'ennovate'@'XpertProWeb' (using password: YES)
GET /testsite/

Line 57 in E:\HostingSpaces\coreglob\core-globalservices.com.ng\wwwroot\testsite\sapphire\core\model\MySQLDatabase.php
Source

48     * Connect to a MySQL database.
49     * @param array $parameters An map of parameters, which should include:
50     * - server: The server, eg, localhost
51     * - username: The username to log on with
52     * - password: The password to log on with
53     * - database: The database to connect to
54     * - timezone: (optional) The timezone offset. For example: +12:00, "Pacific/Auckland", or "SYSTEM"
55     */
56    public function __construct($parameters) {
57       $this->dbConn = mysql_connect($parameters['server'], $parameters['username'], $parameters['password'], true);
58
59       if(self::$connection_charset) {
60          $this->query("SET CHARACTER SET '" . self::$connection_charset . "'");
61          $this->query("SET NAMES '" . self::$connection_charset . "'");
62       }
63

Trace

mysql_connect(<filtered>,<filtered>,<filtered>,<filtered>)
Line 57 of MySQLDatabase.php
MySQLDatabase->__construct(Array)
Line 97 of DB.php
DB::connect(<filtered>)
Line 121 of main.php
require_once(E:\HostingSpaces\coreglob\core-globalservices.com.ng\wwwroot\testsite\sapphire\main.php)
Line 63 of index.php