Executing shell command from MySQL

I know that I'm probably looking for a security hole, but since I managed to do this in Oracle and SQL Server, I will give him a chance:

I am looking for a way to execute a shell command from a SQL script in MySQL. If necessary, you can create and use a new stored procedure.

Note. I'm not looking for the SYSTEM command that the mysql command-line tool offers. Instead, I am looking for something like this:

START IF COND1 ... EXEC_OS cmd1; ELSE EXEC_OS cmd2; END

where EXEC_OS is the method to call my code.

+3
source share
4 answers

, , , Perl, Python, PHP Ruby. SQL-.

. , , , , SQL, :

START TRANSACTION;
CALL MyProcedure();
ROLLBACK;

MyProcedure - .., .

SQL , .

+1

, - , " - " " ".

, - . , ( , ).

, .

, UDF , , C/++ . , .

, script , , , , . , " ". , MySQL.

+1

According to this post on forums.mysql.com, the solution is to use MySQL_Proxy .

0
source

Source: https://habr.com/ru/post/1699561/


All Articles