|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
is it possible to run multiple sql script files at once ?
mysql -u root -p db < script1.sql script2.sql |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 29 mrt, 04:41, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> You might be able to use > > mysql -u root -p db < script1.sql + script2.sql > Nope doesn't work, anyway i did some cat script2 >> script1 magic PS is there a way to change databases in a sql script ? |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
gert <gert.cuykens@gmail.com> wrote in news:060a4d3c-da05-42a0-8cbe-
726a8510eec1@s50g2000hsb.googlegroups.com: > On 29 mrt, 04:41, Jerry Stuckle <jstuck...@attglobal.net> wrote: >> You might be able to use >> >> mysql -u root -p db < script1.sql + script2.sql >> > > Nope doesn't work, anyway i did some cat script2 >> script1 magic > > PS is there a way to change databases in a sql script ? > use newdatabase; |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
gert <gert.cuykens@gmail.com> wrote in news:22bb1196-397b-4a79-9ca4-
2b8d8146a2f1@z38g2000hsc.googlegroups.com: > is it possible to run multiple sql script files at once ? > > mysql -u root -p db < script1.sql script2.sql put all the file names into a master-file.dat file for file in `cat master-file.dat` do mysql -u root -p db < ${file} done cat master-file.dat script1.sql script2.sql script3.sql script4.sql |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
gert wrote:
> is it possible to run multiple sql script files at once ? > > mysql -u root -p db < script1.sql script2.sql > You might be able to use mysql -u root -p db < script1.sql + script2.sql but I haven't tried it. Normally, I just do it from the SQL command prompt: mysql -u root -p db source script1.sql source2 script2.sql -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Mar 29, 4:32 am, "Ana C. Dent" <anaced...@hotmail.com> wrote:
> use newdatabase; doh!!! stupid question :-) |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Mar 29, 4:34 am, "Ana C. Dent" <anaced...@hotmail.com> wrote:
> gert <gert.cuyk...@gmail.com> wrote in news:22bb1196-397b-4a79-9ca4- > 2b8d8146a...@z38g2000hsc.googlegroups.com: > > > is it possible to run multiple sql script files at once ? > > > mysql -u root -p db < script1.sql script2.sql > > put all the file names into a master-file.dat file > > for file in `cat master-file.dat` > do > mysql -u root -p db < ${file} > done > > cat master-file.dat > script1.sql > script2.sql > script3.sql > script4.sql nice, thanks |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Fri, 28 Mar 2008 19:39:31 -0700, gert wrote:
> is it possible to run multiple sql script files at once ? > > mysql -u root -p db < script1.sql script2.sql cat script1.sql script2.sql | mysql -u root -p db -- Remove caps to reply |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
On Mar 29, 12:07 pm, PleegWat
<pleegwat.REM...@CAPS.telfort.nl.INVALID> wrote: > On Fri, 28 Mar 2008 19:39:31 -0700, gert wrote: > > is it possible to run multiple sql script files at once ? > > > mysql -u root -p db < script1.sql script2.sql > > cat script1.sql script2.sql | mysql -u root -p db why didn't i think of that :-) |
|
![]() |
| Outils de la discussion | |
|
|