run a system command from a mysql query ?

Posted on 2004-11-28
Last Modified: 2008-03-06
hi !

strugling with mod_quotatab for proftpd, i have imagined a solution consisting of running a system command in a mysql query.
Such as "update some_table set directory_size='`du -ks /path/to/somedir/`'"

is there some way to do this  ?


PS : this MUST consist of one (or several) mysql queries

my question about mod_quotatab was here :

Question by:safarlebus
    LVL 48

    Accepted Solution

    AFAIK there is no way to do such a thing in the SQL-Statement directly for mysql.
    You can use other script-language (shell, php) to execute that command, get the result and then execute that query with the given result, but in plain SQL it is not supported.

    Oracle has such an ability (, but mysql AFAIK not.
    LVL 17

    Expert Comment

    I can tell you right now that this cannot be done. Sorry, but hernst42 is correct, you will have to depend on an external programming or scripting language.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
    Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (, A SQLite Tidbit: Quick Numbers Table Generation (…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now