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

Development Tools Database Foundations Securing and Maintaining a MySQL Database Setting up Multiple Users

Cannot Connect to Database Server

When trying to test the connection for the admin remote db connection I am unable to connect to it because I don't know what the password is and I get the following error.

Your connection attempt failed for user 'admin' from your host to server at 127.0.0.1:3306: Access denied for user 'admin'@'localhost' (using password: YES)

Please: 1 Check that mysql is running on server 127.0.0.1 2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed) 3 Check the admin has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines) 4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from

3 Answers

You need to login as root and then create the users before setting up the connections.

Here is a basic tutorial:

https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

They are using the terminal to do this, but you can get the same results if you do it in workbench. Set up the new user and their permissions then create a connection.

Joe Law
Joe Law
5,040 Points

Andrew Chalkley , can you solve this for us?

Yeah I'm also confused on this section as I am getting an error as well

Jose Soto
Jose Soto
23,407 Points

Have you tried the 'root' user with no password?

I can get in if I change the username from admin to root. However, Andrew uses the username admin in the video. Is this not important?

Have someone fixed it? I need help...

i had the same issue it said user: root and password:<not stored>

if someone already fix it, please share it to us

Philip Bessa
Philip Bessa
5,396 Points

I'm also stuck with this issue. I somehow KNEW not being able to access server administration would bite me in the rear later on. Using Windows 8.1, 64-bit.

Installed verbatim from the instructor's video. It looks like the video is just too out-dated now. The "access denied" problem is related to a Windows update:

http://stackoverflow.com/questions/25777943/failed-to-connect-to-mysql-at-127-0-0-13306-with-user-root-access-denied-for-us

Unfortunately I tried the solution and it still claimed "Access is denied." in the command prompt. So I hope there's enough space to be in the same boat with you all!