Is it possible to carry out mysql commands directly from the ubuntu cli rather than open mysql?
eg to create a database I would normally type
Code:
user@localhost:~$ mysql -u root -p
then INSIDE the mysql CLI I would type
Code:
mysql> create database db_name;
mysql> quit;
How would I do this (or any other) mysql task directly from the ubuntu CLI?
I want to be able to cut and paste lines and lines of commands into the ubuntu cli and then at a later date write those commands to a sript.sh
I'd rather not write a seperate sql script then import it in my ubuntu cli but if thats the only way then so be it.