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 trialRon Chan
10,987 PointsError Code: 1044. Access denied for user '@localhost' to database 'treehouse_movie_db'
I could not run the sql script for treehouse_movie_db as before when using the new connection created at around 3:00 in this video called "Admin for Remote Connection" . I got the above error message in the action outputwhich prevented the database from being populated. I am not sure what is different about this connection that caused the error.
Looking through some of the forum threads for this video, someone suggested granting privileges to admin, but it isn't working either maybe because I am not doing it right. Anyone found a solution to this while working through this video?
2 Answers
Geoffrey Emerson
18,726 PointsI solved this problem by using the permissions window:
- Go back to a login with root (the way we were working before this video).
- On the left pane, click on "Users and Privileges".
- In the list that appears, you should see the "user1" that we just created. Click on it.
- Click on the tab labeled "Schema Privileges". Here you'll probably see the problem with your privileges. For me, there was a wrong name for the database. I have no idea how that happened.
- I just hit the button for "Revoke All Privileges" to clean out the mistake.
- Click the "Add Entry" button.
- Choose the database we will be working on, treehouse_movie_db. Click OK.
- Now check the box labeled "SELECT".
- Click "Apply" in the bottom right corner.
That fixed it for me, and I was able to follow along with the rest of the video.
Cheryl Jones
13,405 PointsThe solution on this page https://teamtreehouse.com/forum/cant-connect-user1-localhost-to-treehousemoviedb worked for me.
dim chan about 1 year ago okay, did use "to user1@'127.0.0.1'" instead of "to user1@'%'"..
Andreza Feu
Python Web Development Techdegree Student 15,148 PointsI tried this solution but it did not work for me. I'm getting the error:
Failed to connect to MySQL at 127.0.0.1:3306 with user1 Acess denied for user 'user1@localhost' (using password: YES)
Robert Mews
11,540 PointsRobert Mews
11,540 PointsI'm receiving the same error. Is your MySQL instance on your local machine or hosting service? Mine is accessed using a hosting service as that's where I conduct development and deploy. I quite can't figure out how to change admin services either. Hoping someone a little more knowledgable can help us.