Creating DB, USER, GRANTS and map to an account via SSH
My problem is about creating DB, USER, GRANTS and map db and user to an account.
My script is:
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?
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?
-
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. 0
Please sign in to leave a comment.
Comments
2 comments