I often find the need to check a table structure (to check column names for instance when writing a PHP script). My one single purpose is: speed. I use "Adminer" and in a few clicks I can check it out. But I want to do this faster, with a command line window I have always open anyway. So I'd like to create a function that allows me to do something like:
mysql -uuser -ppassword && USE database; && DESCRIBE table;
I would alias this in a way that I can call:
describe database.table
And voilá, I get the database structure. But my issue is: how can I log into MySQL AND run certain queries in one script?? I have not found a way to do this.