Forums

Exporting a view as csv

Is it possible to export a view? How would this be done?

What's a view? Is this a django view? Or something else?

A view created in mysql?

In a bash console:

mysql -h username.mysql.pythonanywhere-services.com -u username 'username$database_name' -p -e "select * from table_name;" > out.txt

replacing username, database_name and table_name with the appropriate values.

The result of your query will be in out.txt