Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Mysql Module to Import SQL file

Discussion in 'cPanel Developers' started by whatshakin, Aug 20, 2010.

  1. whatshakin

    whatshakin Registered

    Jul 30, 2010
    Likes Received:
    Trophy Points:
    I've been looking for a way to import a prepared sql file into a database using the XML or JSON API or some other approach which can be done dynamically with php.

    Is there a function hook that will allow me to do this?

    I have a bunch of other functions working nicely from the Fileman module, but I can't find how to get this thing going.

  2. cPanelDavidN

    cPanelDavidN Integration Developer

    Dec 17, 2009
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Troy,

    Does this have to be done via HTTP or a cPanel UI? For something like what you describe, I'd consider transporting the sql file and executing the mysqlimport all via SSH if you're remotely interacting with the cPanel system.

    The only way I can think to do it via an existing API call would be if you had your sql file already on the cpanel system, compressed and named like a cPanel generated MySQL backup, you could use the Fileman::restoredb and that perform whatever valid actions are in your .sql file.

    Best Regards,
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice