Im trying to empty a database and import into it from a bash script. Im using MySQL from Mamp Pro. The following logs me into MySQL but doenst run any of the operations.
/applications/MAMP/library/bin/mysql -u root -p
DROP DATABASE database_name;
CREATE DATABASE database_namem;
database_name < /file-to-import.sql;
I think you're suppose to execute the query as a string like this:
/applications/MAMP/library/bin/mysql -u root -pYourPassword -e "DROP DATABASE database_name;"
It might be possible to execute multiple queries this way by separating with ;
but I have not tried.