#1 (permalink)  
Old 07-29-2009, 07:34 AM
Registered User
 
Join Date: Jul 2009
Posts: 5
cagy is on a distinguished road
Remote database creation

Hi all,

I've looked through the API docs but couldn't seem to find what I'm looking for. I'm looking for a way to remotely create/delete/edit databases and database users using only the user's cPanel login username and password.

I've seen a reference to "adduserdb", but didn't see it in the API docs. Here is a sample of what I saw:

Code:
user=$cpanel_username&xmlin=".urlencode("<cpanelaction><module>Mysql</module><func>adduserdb</func><apiversion>1</apiversion><args>".$cpanel_username."_$mysql_database</args><args>".$cpanel_username."_$mysql_username</args><args>ALL</args></cpanelaction>
It would be fantastic if someone could point me in the right direction.

Thanks a lot!

Cagy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-29-2009, 08:52 AM
Registered User
 
Join Date: Jul 2009
Posts: 5
cagy is on a distinguished road
Alternatively, and perhaps a better solution, is it possible to create databases etc... from the command line if you ssh into the user's account?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-29-2009, 09:05 AM
Staff
 
Join Date: Apr 2005
Location: Houston, TX
Posts: 212
cPanelMatt is on a distinguished road
There is a way to do this via CLI, using one of cPanel's cPwrap scripts, this is subject to change at any time:

Code:
/usr/local/cpanel/bin/mysqlwrap ADDDB foobar
Now, as for xml-api, this is undocumented and an API1 call:

Code:
<cpanelaction>
  <apiversion>1</apiversion>
  <module>Mysql</module>
  <func>adddb</func>
  <args>foobar</args>
</cpanelaction>
__________________
Matt Dees
cPanel, Inc.
cPanel Integration Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-29-2009, 09:33 AM
Registered User
 
Join Date: Jul 2009
Posts: 5
cagy is on a distinguished road
Great, thanks for the info. Where can I find the documentation for mysqlwrap and any other CLI utilities?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-29-2009, 09:43 AM
Staff
 
Join Date: Apr 2005
Location: Houston, TX
Posts: 212
cPanelMatt is on a distinguished road
Unfortunately at this time I am not aware of any such documentation, although you can strace it out of cpsrvd if you are familiar with process tracing.
__________________
Matt Dees
cPanel, Inc.
cPanel Integration Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-21-2009, 02:07 PM
Registered User
 
Join Date: Nov 2005
Posts: 16
rajuru is on a distinguished road
check if it helps you anyway:
The HungryCoder » Blog Archive » cPanel database administering class
__________________
[My Blog] :: [Projanmo.com] :: [A/V Search Engine] :: [Flash Gamz]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic importing of database on account creation Phoenix cg cPanel and WHM Discussions 0 02-21-2008 05:03 PM
Database creation bug. beddo cPanel and WHM Discussions 1 02-20-2008 01:36 PM
Postgres database creation issue ( wrapper ) parisdns cPanel and WHM Discussions 1 10-08-2007 03:14 PM
Remote package creation anarckie cPanel and WHM Discussions 2 05-29-2004 02:01 PM
Remote Database Access voxtreme-fred cPanel and WHM Discussions 0 06-19-2002 11:30 PM


All times are GMT -5. The time now is 08:42 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc