Recent

Author Topic: Can I enter MySQL prompt then run sql  (Read 201 times)

nikel

  • Sr. Member
  • ****
  • Posts: 282
Can I enter MySQL prompt then run sql
« on: May 16, 2026, 09:51:26 pm »
Hello, I'm planning to develop a Linux console program which would run another program then send its commands, then get the output. Is this possible?

tooknox

  • New Member
  • *
  • Posts: 40
Re: Can I enter MySQL prompt then run sql
« Reply #1 on: May 16, 2026, 10:05:08 pm »
TProcess + poUsePipes should do the job, but I don't think it's a good idea for mysql, there is a dedicated library for mysql (and you would know that). May be if you provided more details. Also there would be the whole headache of managing credentials (properly)

nikel

  • Sr. Member
  • ****
  • Posts: 282
Re: Can I enter MySQL prompt then run sql
« Reply #2 on: May 17, 2026, 03:41:56 pm »
Thank you for your explanation.

Zvoni

  • Hero Member
  • *****
  • Posts: 3398
Re: Can I enter MySQL prompt then run sql
« Reply #3 on: May 18, 2026, 08:50:42 am »
TProcess + poUsePipes should do the job, but I don't think it's a good idea for mysql, there is a dedicated library for mysql (and you would know that). May be if you provided more details. Also there would be the whole headache of managing credentials (properly)

Yepp. Why in blazes calling the command-line client for MySQL, passing it parameters, then reading the output?
Having the MySQL CLI-Client installed means you have the client-libs, and the CLI just calls the same functions/procedures you can call yourself using the correct classes
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018