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

The Natural Philosopher <[email protected]> Tue, 31 Oct 2023 20:00:21 +0000
Newsgroups comp.databases.mysql
Organization A little, after lunch
Message-ID <[email protected]>
On 31/10/2023 15:42, ^Bart wrote:
> Hi guys,
> 
> I need to write in bash a script which do these things:
> 
> 1) Login to MariaDB;
> 2) Truncate a table to make it empty;
> 3) Import data from a file to this table.
> 
> I found this guide 
> https://notearena.com/lesson/how-to-access-databasemysql-mariadb-in-linux-shell-scripting/ and I'd like to know if it's the right way! :)
> 
> Now I do everything manually...
> 
> Regards.
> ^Bart

I'd almost certainly write that in C or PHP.  The APIS are very simple 
for something like that.



-- 
If I had all the money I've spent on drink...
..I'd spend it on drink.

Sir Henry (at Rawlinson's End)