Re: From bash script (Debian Bookworm) login and query to MariaDB

"J.O. Aho" <[email protected]> Thu, 2 Nov 2023 15:57:53 +0100
Newsgroups comp.databases.mysql
Message-ID <[email protected]>
On 02/11/2023 15.07, ^Bart wrote:
>> */5 * * * * (root) (/usr/bin/mysql -umy_username -pmy_password 
>> databasename <
>>   /home/itoffice/query.sql)
> 
> */5 * * * * (itoffice) (/usr/bin/mysql -u username -p password db_name < 
> /home/it_office/query.sql)
> 
> It doesn't work :\ but it doesn't work also if I insert it in a php 
> script; here below is the working *.sql file used from MariaDB CLI:

What error mail is sent from crontab? should be sent to the local 
machines root user unless you have set MAILTO to another email address.

in worst case use less and read the /var/spool/mail/root should be in 
the end of the file.
sure you can use the alpine or mutt to read the mail too.

By the way, do you have characters like '#;" in your password? Those 
tend to cause issues when using this way. I would recommend the usage of 
profile.


-- 
  //Aho