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.

Archive

Our old forums are still available as a read-only archive.

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

Fatal error: DATABASE ERROR: Couldn't connect to MySQL database in C:\wamp\www\silverstripe-v2.2.3\sapphire\core\model\Database.php on line 431


Reply

3 Posts   3672 Views

Avatar
Brigham

9 December 2008 at 1:40pm Community Member, 5 Posts

Kia ora (it means hi). I am installing SilverStripe for the first time and went to my browser, inserted the URL: localhost:3000/silverstripe-v2.2.3/. It did what is was suppose to do, i ticked the "empty template, ready to begin the tutorial", clicked on "Install SilverStripe" and got a page that said a whole lot of things, one of them being something like: if this doesn't work, refresh your browser--i did and then ticked the "empty template..." box again and clicked "install SiverStripe" then got this page and it won't do anything else:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\wamp\www\silverstripe-v2.2.3\sapphire\core\model\MySQLDatabase.php on line 41

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\silverstripe-v2.2.3\sapphire\core\model\MySQLDatabase.php on line 42

Fatal error: DATABASE ERROR: Couldn't connect to MySQL database in C:\wamp\www\silverstripe-v2.2.3\sapphire\core\model\Database.php on line 431

---

any recommendations on what i need to do now? Thanks.

Avatar
Hamish

9 December 2008 at 3:26pm Community Member, 712 Posts

have a look at /mysite/_config.php

First of all, it should exist. If not, run the installer again.

Second of all, it should contain something like

$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "localhost",
   "username" => "root",
   "password" => "",
   "database" => "blahblah",
);

make sure all those details are correct.

Third of all, are you sure your mysql database is running and accessible with the supplied credentials?

Avatar
Brigham

9 December 2008 at 9:42pm Community Member, 5 Posts

Thanks for your reply. the /mysite/_config.php does not exist. I tried re-installing it and still the same. I viewed the video and followed those instructions (installed wamp; unzipped SilverStripe; put it in the www folder; copied some file; changed its name..... and then error. Very sure i followed the video exactly.