Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
PLUS
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
PLUS
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.