Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Vesta CLI
  • Search

auto db creation script?

Questions regarding the Command Line Interface
CLI
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
viraladmin
Posts: 57
Joined: Thu Apr 27, 2017 7:40 pm

Os: Ubuntu 15x
Web: apache + nginx
auto db creation script?
  • Quote

Post by viraladmin » Fri Apr 28, 2017 2:11 am

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:

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'
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)
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “CLI”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password