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

Dan Badertscher
Dan Badertscher
5,327 Points

(MySQL) Error: Error formatting SQL query: empty string given as argument for ! char

I am getting the following error message:

" 19:11:32 SELECT * FROM movies LIMIT 0, 1000 Error: Error formatting SQL query: empty string given as argument for ! character "

after running this command:

SELECT * FROM movies ;

How can I get this command to work properly?

2 Answers

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

Hi Dan,

According to this post on Stack Overflow, you may not have your database selected. In the left panel, try double-clicking the database you want to use (it will be bold when selected), then run your query again.

Hope that helps!

Stephen Moss
Stephen Moss
2,285 Points

Thanks! Had the same problem

Woohoo! Love a simple answer.

anthony crowell
anthony crowell
Courses Plus Student 10,953 Points

Hi I'm not sure how many records are in that table but you might try upping your LIMIT and using the schema name: SELECT * FROM treehouse.movies LIMIT 0, 2000;

Thank you, Shawn. This worked for me as well... Lots of interesting little challenges here with the differences between the videos and what we see with the latest version of MySQL.