We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
auto db creation script?
-
- Posts: 57
- Joined: Thu Apr 27, 2017 7:40 pm
- Os: Ubuntu 15x
- Web: apache + nginx
auto db creation script?
So I was looking at viewtopic.php?t=12221 and saw the following suggestion for manually adding databases created outside of vestacp to users inside vestacp:
I was wondering if it would be possible for someone (way outside my ability) to write a script that would do a root connection to the database, check all database names, and generate a series of database files based on user name matching.
Basically my thought is, root should be able to scan all databases. The for example if a database starts with admin_ add that to the admin database file and get the user and md5 for the user on that database. I would assume the date and time could use the current data and time from server.
Would something like this be possible? It would be very handy at importing an sqldump file into user accounts (and yes I am aware that would mean the users must first be created)
Code: Select all
DB='admin_ru' DBUSER='admin_ru' MD5='*6856731FA3B869EC57DD182553B62343AEC3AE55E' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='12:13:55' DATE='2015-10-23'
DB='admin_test' DBUSER='admin_test' MD5='*DCFCFC391AC17E17A2F4A95EB13DB49E7A82FA4' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='00:02:26' DATE='2015-11-29'
Basically my thought is, root should be able to scan all databases. The for example if a database starts with admin_ add that to the admin database file and get the user and md5 for the user on that database. I would assume the date and time could use the current data and time from server.
Would something like this be possible? It would be very handy at importing an sqldump file into user accounts (and yes I am aware that would mean the users must first be created)