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!

Creating DB, USER, GRANTS and map to an account via SSH

Discussion in 'cPanel Developers' started by MattiaMerliniM, Sep 28, 2015.

  1. MattiaMerliniM

    Joined:
    May 22, 2015
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    My problem is about creating DB, USER, GRANTS and map db and user to an account.
    My script is:
    Code:
    ACCOUNT="testaccount"
    DBHOST="localhost"
    DBNAME="wp_wpcli"
    DBUSER="wp_wpcli"
    DBPSW="wp_wpcli"
    echo "CREATE DATABASE $DBNAME;" | /usr/bin/mysql
    echo "CREATE USER '$DBUSER'@'localhost' IDENTIFIED BY '$DBPSW';" | /usr/bin/mysql
    echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO '$DBUSER'@'localhost';" | /usr/bin/mysql
    /usr/local/cpanel/bin/dbmaptool "$ACCOUNT" --type mysql --dbs '$DBNAME' --dbusers '$DBUSER'
    
    After executing this code logging in cPanel I can see the database and the user but not the grant (see this screenshot mediafire.com/view/k1sg2uxf9t28b4h/mysql-cpanel.png) .
    How can I make cPanel shows the privileged user?
     
    #1 MattiaMerliniM, Sep 28, 2015
    Last edited by a moderator: Sep 28, 2015
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    720
    Likes Received:
    123
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Looks like a bug, I tested myself with the same results, however if you click on Add User to add the user to the database, all the privileges are already pre-filled so looks like just a small bug.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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