Add User for Database form shell

sudonic

Member
Oct 29, 2007
11
0
51
Hi,

I need to create a database more than 200. i create shell script and using this code :

in mysql :
Code:
create database USERNAME_dbname;
GRANT ALL PRIVILEGES ON USERNAME_dbname.* TO 'USERNAME_dbuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
and user dbmaptool :
Code:
/usr/local/cpanel/bin/dbmaptool USERNAME --type mysql --dbs USERNAME_dbname' && /usr/local/cpanel/bin/dbmaptool USERNAME --type mysql --dbusers 'USERNAME_dbuser'
everything ok to this section, but in cPanel user don't added to database. i have read this :

http://forums.cpanel.net/f354/creating-database-manually-193012.html
http://forums.cpanel.net/f354/create-mysql-database-user-via-shell-71968.html
http://forums.cpanel.net/f354/creating-database-manually-193012.html

how can i fix this problem ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

Do you experience the same problem when adding a user to a database via "WHM Home » SQL Services » Database Map Tool"?

Thank you.
 

sudonic

Member
Oct 29, 2007
11
0
51
Hello :)

Do you experience the same problem when adding a user to a database via "WHM Home » SQL Services » Database Map Tool"?

Thank you.
Yes, i tested this option, but can't help me, i need this problem solved without WHM GUI, because i have many database and i can't create DB & user & add user to DB & import SQL file in DB manually.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Feel free to open a support ticket so we can take a closer look:

Submit A Ticket

You can post the ticket number here so we can update this thread with the outcome.

Thank you.