Welcome Guest, Not a member yet? Register   Sign In
Database connection error
#4

[eluser]igniterman[/eluser]
Thanks for this.
I still get an error, and can't explain it:
The output of the above is an error, it breaks at the mysql_connect:
Code:
Message: mysql_connect() [function.mysql-connect]: Access denied for user 'my_user'@'localhost' (using password: YES)
Filename: config/database_DEBUG.php
Line Number: 20
The access denied is a big clue, but the print_r displays the array being passed, and that includes the correct username and password for the database, so I can't see why its saying access denied.

Actually, I tried moving the line for mysql_select_db to be above the mysql_connect. That changed the error message to start mentioning the correct database name, but the username reported in the error was blank.
Moving it back again to where it is above, means that the error message doesn't mention the database name.

i.e. it becomes
Code:
Cannot connect to the database because: Access denied for user ''@'localhost' to database 'my_db'


Messages In This Thread
Database connection error - by El Forum - 05-28-2011, 08:27 AM
Database connection error - by El Forum - 05-28-2011, 11:12 AM
Database connection error - by El Forum - 05-28-2011, 12:00 PM
Database connection error - by El Forum - 05-28-2011, 04:17 PM
Database connection error - by El Forum - 05-28-2011, 04:25 PM
Database connection error - by El Forum - 06-01-2011, 05:24 AM
Database connection error - by El Forum - 08-19-2011, 02:42 AM
Database connection error - by El Forum - 08-19-2011, 03:35 AM
Database connection error - by El Forum - 03-07-2012, 05:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB