Is there an easy way to send mysql query results from mysql console directly or from linux console? Good formatting is a bonus.
mysql -u .. -p.. -H <<<"your query" | mutt -s 'subject' email@email.com
if you think HTML formats better
I personally prefer \G
\G
mysql -u .. -p.. -N <<<"your query\G" | mail -s 'subject' email@email.com
An alternative to the other mutt answer is just the old mail from the mailx package:
mail
mysql -uuser -ppass dbname < queryfile.sql | mail -s 'Your query output' email@example.com
mysql -u <user> -p<password> <database> -e "<query>" | sendmail <emailaddress>
Source: https://habr.com/ru/post/896424/More articles:Several resque operating modes that create additional processes - resqueCan someone explain this lambda expression to me? I like it - c #Best way to check if a directory is available in a BAT script? - windowsConvert Hexadecimal to Double - c #When using HMAC to sign a message, is it advisable to salt a key, a message, or both? - hashGetting the nth line of a text file in C ++ - c ++POST Rest Service POST method does not work in Fiddler - jsonIs there a Vim plugin for highlighting Hex, Rgb, Colors - vimHow to change font of axis value to JFreeChart - javaCreate transfers from a database or vice versa? - enumsAll Articles