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

Access denied for user ''@'localhost' to database 'treehouse_movie_db'

GRANT SELECT ON treehouse_movie_db TO user1@'%' IDENTIFIED BY 'password' Access denied for user ''@'localhost' to database 'treehouse_movie_db' unable to execute any type of query.

2 Answers

Oh, sorry, you should have a dot and asterisk/star after the database name to indicate that the user should have access to all tables:

GRANT SELECT ON treehouse_movie_db.* TO user1@'%' IDENTIFIED BY 'password' 

Thanks very much..it solved the same way as you said.. your reply bit late , one of my friend rectify the issue

thanks mate

Maybe try wrap the user name in single quotes too?

still not working.i have same error.plz help me