Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Create MySQL database cPanel from SSH

SadySady Member

Hello,

I'm creating a bash script to deploy wordpress with a theme, mysql import, changes in mysql DB like change siteurl, home & password value to website name itself & some random password.

I'm done with all the things & it's working like a charm but got into an issue. Like i have a cPanel username "saad" & i want to create database & database user "saad_wp" All goes good but the issue is that it doesn't show under the cPanel account as i'm creating it through root.

Is it somehow possible to do it in a way that it'll be totally automated & it also shows under cPanel account ?

Will really appreciate your help :)

Thank you !

Comments

  • I think the only way would be to add it yourself using an SQL command to the cpanel database, but I may be wrong.

  • upfreakupfreak Member
    edited December 2014

    Once you create the database, you must run the cpanel db mapping tool via SSH and then it will show up in cpanel.

    /usr/local/cpanel/bin/setupdbmap
    

    Other method is to create the db using cpanel Api calls.

  • @bf1 said:
    I think the only way would be to add it yourself using an SQL command to the cpanel database, but I may be wrong.

    I'm doing this way, all is going good but it doesn't show in cPanel (GUI), it's a production server so can't mess the things.

  • @upfreak said:
    Once you create the database, you must run the cpanel db mapping tool via SSH and then it will show up in cpanel.

    > /usr/local/cpanel/bin/setupdbmap
    > 

    Other method is to create the db using cpanel Api calls.

    Thank you for the explanation, will try that DB mapping tool & let you know.

    Do they also offer SSH based API calls ? :o Checked that but couldn't find that & unfortunately i don't have knowledge of JSON/PHP etc.

Sign In or Register to comment.