email - Mysql Export and send mail using Cron job -


i want export select query in mysql , result file needs send mail using cronjob in mysql.

please help, suggest solution.... thanks.

you can execute queries using mysql cli. example:

mysql -u 'db_user' -p'db_pass' -h 'db_host' database_name <<< 'select * table_name' 

a basic example of cron entry:

0 * * * * /usr/local/bin/mysql -u user -ppass -h 127.0.0.1 shop_database <<< 'select * customers' | mail -s 'customers export' 'email@example.org' 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -