- This topic is empty.
-
AuthorPosts
-
April 28, 2013 at 11:26 am #133434__Participant
Did you check your dsn string, username and password? Are they correct?
April 28, 2013 at 3:37 pm #133447Nick01Member@traq
1) Does it always give that error (can you ever connect to your DB, even PHPMyAdmin)?
Yes,I can connect to my DB in PHPMyAdmin,but other times I am haunted by:Connection failed: SQLSTATE[28000] [1045] Access denied for user ‘db_user’@’localhost’ (using password: YES)
2) How are you trying to create that database? Are you trying to import it using an sql file? Can you create a new table using the [Create table] button in PHPMyAdmin?
Prior to your comment today, I didn’t realize I was importing a database inside database instead of tables. Do web host allow importing an entire database? Because all I can see here
is “Create a new database option”, then your supposed to log into PHPMyadmin(where you can only import tables)3) I followed your step and edited my Base.php,but then this happened :
[Warning](http://oi43.tinypic.com/34tesue.jpg “And another warning.”)
Is my [syntax](http://oi40.tinypic.com/2koh6q.jpg “syntax”) correct ? Should the Dns field be $Linkor $Link (since all content is uploaded in site directory), either ways
it shows the same warning.I really appreciarte your help.Thank you @CrocoDillon too.
April 28, 2013 at 6:45 pm #133457__ParticipantYour earlier warning (“`Connection failed: SQLSTATE[28000] [1045] Access denied for user ‘db_user’@’localhost’ (using password: YES)`”) was being generated in that `catch` block. When you tried my new `exit` command, we found out what the problem really was: the file which defines those constants is missing (because they were missing, an exception was thrown inside the `catch` block, which results in the fatal error you saw).
I think you need to go back to that tutorial (and/or the github page Crocodillon linked) and make sure you *have* all of the files you actually *need*. I wouldn’t be surprised if others are missing too.
Specifically, once you get that `inc/constants.inc.php` file in place, you need to edit it so that it defines those constants with *your* DB credentials (because they’re missing, PDO is using default values, which obviously aren’t correct).
*****
to answer your other questions:> I didn’t realize I was importing a database inside database instead of tables. Do web host allow importing an entire database? Because all I can see here is “Create a new database option”, then your supposed to log into PHPMyadmin(where you can only import tables)
I don’t know if the file you import is trying to create tables or databases. You can open it in a text editor and just read it to find out.
If it’s creating tables, you shouldn’t have a problem as long as you’ve already selected a DB to use in PHPMyAdmin.
If it’s creating a new database, you might (probably will) have problems, since many shared hosts don’t allow you to create new databases programmatically (they want you to do it via your CP instead).
> I can connect to my DB in PHPMyAdmin,but other times I am haunted by:
Connection failed: SQLSTATE[28000] [1045] Access denied for user ‘db_user’@’localhost’ (using password: YES)To clarify, you sometimes get that error in PHPMyAdmin?
April 29, 2013 at 1:27 am #133466Nick01MemberI have updated constants.inc.php file.All the required files were present.
I’m presented with the same error:
Connection failed: SQLSTATE[28000] [1045] Access denied for user ‘u265831516_nick’@’localhost’ (using password: YES)April 29, 2013 at 5:23 am #133477CrocoDillonParticipantBy the way, change the `include_once` to `require_once` (for the constants) so you’ll get an error there if something goes wrong.
April 29, 2013 at 1:34 pm #133525Nick01Member@CrocoDillon
Same error
Connection failed: SQLSTATE[28000] [1045] Access denied for user ‘u265831516_nick’@’localhost’ (using password: YES)I get a feeling it has got something to do with the privileges granted to the user of the created database?
May 8, 2013 at 4:58 am #134414Nick01MemberThank you guys, the problem has been solved. I tried out a different web hosting service and figured out the MySQL host name.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.