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!
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
Ron Chan10,987 Points
Error 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?
I 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.
The 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@'%'"..