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.

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:
    275
    Likes Received:
    31
    Trophy Points:
    28
    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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,814
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page