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

Maximilian Lemos
Maximilian Lemos
1,654 Points

Error when running the provided script in database foundations.

When I hit the lighting bolt as instructed I don't get the series of check marks, I get this error:

15:39:28 DROP DATABASE IF EXISTS treehouse_movie_db Error Code: 1044. Access denied for user ''@'localhost' to database 'treehouse_movie_db' 0.000 sec

1 Answer

Khaleel Hamid
Khaleel Hamid
5,258 Points

Do you have the treehouse_movie_db schema selected? And is your xampp started/working?

// if you haven't created one yet
CREATE DATABASE treehouse_movie_db  

// This would work too
CREATE DATABASE IF NOT EXIST treehouse_movie_db  

// highlight this code and hit the lightning button
USE treehouse_movie_db 

// Do this if it still doesn't work and create it again
DROP DATABASE treehouse_movie_db  

DROP DATABSE IF EXISTS treehouse_movie_db