The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysql Module to Import SQL file

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

  1. whatshakin

    whatshakin Registered

    Joined:
    Jul 30, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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.

    Thanks
    Troy
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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,
    -DavidN
     
Loading...

Share This Page