How can I add multiple databases at once to my server?
In the past I was able to run the phpmyadmin SQL query CREATE to make databases. Now cPanel says to create all databases using the cPanel wizard. I need to create 100's of databases at once, not one at a time: what is the current method to do this?
If I bypass cPanel and use the servers CLI to create databases, will they be detected and registered by cPanel?
Thank you,
Michael Robinson
-
You can create databases via CLI but you need to assign them individually to each cPanel account still (though with some scripting you can do a batch update). Read more about it here:
Andrew N. - cPanel Plesk VMWare Certified Professional
Do you need immediate assistance? 20 minutes response time!*
EmergencySupport - Professional Server Management and One-time Services0 -
You could also use the API tool to create databases in a more automated fashion:
https://api.docs.cpanel.net/openapi/cpanel/operation/create_database/
0 -
I was able to batch create databases and map them to a cpanel user account.
Is there a way to map a virtual user to a batch of databases, once they are mapped to an account in cpanel, using the CLI?
Thanks!
Michael
0 -
Sure! You can use this tool to achieve that, which is just the Database Map Tool interface on the command line:
0 -
How do I use the cpanel dbmaptool to map the db user to the db?
When I use the options below, the cpanel account doesn't display the virtual user in the "Privileged Users" column, but the dbs do appear in the "Database" column.
/usr/local/cpanel/bin/dbmaptool username --type 'mysql' --dbs 'db1, db2' --dbusers 'virt1, virt2'
(Note: The privileges have been assigned to the virtual user for each db in MySQL)
0 -
The users would have needed to be created inside cPanel. If they are outside of that user's cPanel account, they will not show up in the interface.
0
Please sign in to leave a comment.
Comments
6 comments