How to run cql files (.cql) from within cqlsh?

Pinocchio picture Pinocchio · Mar 19, 2014 · Viewed 84.6k times · Source

The problem that I am having is that I want to run the following command (and I can't):

cqlsh < cql_directory/cql_create_stuff.cql

Because I have not logged in to cqlsh.

So I logged in:

cqlsh -u 'my_username' -p 'my_super_secret_password'

and now I tried doing the command in cqlsh shell but It just responds with a syntax error.

Basically, how do I login into cqlsh and run an external CQL script in my file system?