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.
How to import a .SQL file when a specific user creates a database?
-
- Posts: 5
- Joined: Sat Feb 04, 2017 7:35 pm
How to import a .SQL file when a specific user creates a database?
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?
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?