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 Installing MySQL Server and MySQL Workbench Running a Script and Using MySQL Workbench

when I type in "SELECT * FROM movies;" it gives me "error: error formatting sql query: empty string given as argument...

...for ! character..." I typed the same thing as the instructor and clicked the lightning. I tried actors and got the same error

7 Answers

nevermind, I was supposed to set the movie_db to default

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

MOD edit: changed to Answer and marked as Best Answer as this has solved other students' issues with this part (including my own.).

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Hi Greg,

Whichever database is bold, that is the one that is 'set to default.

If you need to set one to default, you can: 1. double-click on it in the list. OR 2. right-click and choose 'set as default.' OR in the work-area, execute the command USE movie_db;

Hope this helps you.

Yes it does thank you ... found that out about 30 seconds ago lol,,,I'll just keep plodding on now ...thank you again for the response

Thank you for this answer. It really helped figure out the problem :)

Andrew Chalkley explains how to set a database as the default in the video following this one ...

I have exactly the same problem but now it works a treat.... only took me an hour how to set the mysql workbench up! I realised I had to set the credentials up in MAMP lol

Not done much with SQL before so this should really help me out.... hopefully

Happy SQL'ing lol

Michael O'Kane
Michael O'Kane
5,896 Points

for anyone having a problem with this on my workbench (lastest?) it seems to only accept the full path

SELECT * FROM treehouse_movie_db.movies;

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Do you have treehouse_movie_db set as your default database?

Michael O'Kane
Michael O'Kane
5,896 Points

Think I got a bit ahead of myself. if you default the database you dont need to use the extended syntax. My problem was that I hadn't got to that part of the video yet.