Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Byron Anderson
7,009 PointsAccess Denied! (password: CONFLICT)
The problem persists! in phpMyAdmin (accessed via the XAMPP Control Panel v3.2.1, Module: MySQL, Admin) it says NO PASSWORDS are set, but when I type localhost/database.php into my browser the FATAL ERROR says (using password: YES) like this
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in C:\xampp\htdocs\database.php:3 Stack trace: #0 C:\xampp\htdocs\database.php(3): PDO->__construct('mysql:host=loca...', 'root', 'root') #1 {main} thrown in C:\xampp\htdocs\database.php on line 3
I REPEAT! the Users Overview panel of phpMyAdmin says Password for 'user'@'localhost' is NO, but you can see in the FATAL ERROR message it says (using password: YES)
HOW CAN BOTH BE TRUE !?
in the XAMPP Shell (or Terminal?) I typed the following
mysql -u root -p
which then responded: Enter password: Here I've tried entering -root- as well as -the password I was required to set during the MySQL Workbench install- ...All of which returned the ERROR:
Setting environment for using XAMPP for Windows.
Byron@BANDERSON11 c:\xampp
#mysql -u rood -p
Enter password: ****
ERROR 1045 <2800>: Access denied for user 'root'@'localhost' <using password: YES>
Byron@BANDERSON11 c:\xampp
AND ONCE MORE: the Users Overview panel in phpMyAdmin says NO PASSWORD for 'user'@'localhost' ...
Please, forgive my depleted patience here: my sense of humor has become even LESS than my degree of web-development understanding (which itself is pretty low) !
Thank You (anybody! Randy Hoyt maybe? or Andrew Chalkley?)
David Negrete
19,909 Pointsif you changed the password on phpMyAdmin and it stopped working, I assume this is what you did. You need to go to you xampp/apps/phpMyadmin open the config.inc folder. There you will be able to change the password to your phpMyAdmin password.
1 Answer
Byron Anderson
7,009 PointsWELL... I don't know if I actually have a 'problem' ... I don't think I do because I tried one thing I hadn't thought of before which looks like this:
<?php
$db = new PDO("mysql:host=localhost;dbname=shirts4mike;port=3306","root");
var_dump($db);
..before, as per Randy in his video @ http://teamtreehouse.com/library/using-php-with-mysql/connecting-php-to-mysql/getting-started-with-pdo-2 I was adding a 3rd string to the argument for password: "root".
Including only 2 arguments allows my browser to show the same thing as seen in Randy's browser...
So, that's all for now, I suppose. Thank You all!
dylanpardee
Courses Plus Student 8,740 Pointsdylanpardee
Courses Plus Student 8,740 PointsSomething you could try...
Log in through the shell and when it asks you for "Enter password:" leave it blank(just hit return).
Some questions I have:
Did you update XAMPP?
Is this a new install or have you been working with this?
Did you ever log into the mysql server (before/after Update)?
When all else fails, is it an option to back up your work(config files, database, etc) and do a clean install?
Good Luck :)