Forums | Mahara Community

Support /
No connection to the database (error 1045)


anonymous profile picture
Account deleted
Posts: 2

17 September 2009, 7:49

Since i've installed Mahara on my site it gives an error after the database creation.
Name of my database: website_mahara
Name of the user who's connected to the database: website_steve
Password: none

The error:

Mahara could not connect to the application database.

* If you are using Mahara, please wait a minute and try again
* If you are the administrator, please check your database settings and make sure your database is available

The error received was:
mysql error: [1045: Access denied for user 'website_steve'@'localhost' (using password: NO)] in CONNECT(localhost, 'website_steve', '****', website_mahara)

Does somebody know how to delete this error and makes my Mahara works?

Thank you very much!

anonymous profile picture
Account deleted
Posts: 1643

17 September 2009, 17:04

Hi - you have some issue with your connection details to the MySQL database - you can probably get the correct settings from your control panel?
anonymous profile picture
Account deleted
Posts: 19

21 September 2009, 3:44

Hi Nigel,

 

I'm Steve's collegue and we are both trying to get Mahara working. So I'll answer your reply.

We have used our cPanel settings. We have given access to the only user to use the database. 

We have changed the config.php in the directory mahara so that it contains the right values. At least, we think we did, cause there must be something wrong.

There are the values in the config.php, stored in the directory mahara:

--- start code ---

// valid values for dbtype are 'postgres8' and 'mysql5'
$cfg->dbtype   = 'mysql5';
$cfg->dbhost   = 'localhost';
$cfg->dbport   = null;
$cfg->dbname   = 'website_mahara';
$cfg->dbuser   = 'website_steve';
$cfg->dbpass   = '';
$cfg->dbprefix = '';

  --- end code ---

I have a screenshot from my cPanel, but for security I think it is not save to post it here in public. I can send you that apart from this forum.

 Hopefully you can help us.

Jaap van de Putte

anonymous profile picture
Account deleted
Posts: 1643

21 September 2009, 18:19

You have done things correctly on the Mahara side - I think the problem is now to do with whom you have actually allowed to access your database. Your connection details say:

"Allow the user 'website_steve', using no password, to access the database 'website_mahara' that is available on the host 'localhost' on the default port".

If you have not set up your MySQL to allow this, then your connections will be rejected. You'll have to check that side of things.

Typically, you can use a GRANT command to allow access - the MySQL manual will have more info about this - or in CPanel there might be a screen to manage permissions.

anonymous profile picture
Account deleted
Posts: 19

23 September 2009, 10:12

Hi Nigel,

Thanks for your advice. Our Mahara installation works! The problem seemed to be that we assigned access to a user without a password. We created an extra user with a password and than it all works.

Thanks for your quick respons!

5 results