Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Scripting / API
  • Search

How to import a .SQL file when a specific user creates a database?

Questions regarding the API
Application Programming Interface
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
lucasbustamante
Posts: 5
Joined: Sat Feb 04, 2017 7:35 pm

How to import a .SQL file when a specific user creates a database?
  • Quote

Post by lucasbustamante » Thu Apr 19, 2018 6:25 pm

I'm building one of those free trial SaaS, I have managed to create a database programatically with Vesta's API command v-add-database, but now I would like to automatically import a .SQL file into it.

To import the SQL file when a database is created, I'm using a PHP script that read a file and queries line by line, but it's taking an average 90~100 seconds to process the entire default database, which has around 5k lines.

I feel like I could achieve this with a bash script, but I suck at Linux. Can someone give me a sample of such script?
Top


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

Return to “Scripting / API”



  • 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