mysql> source script1.sql, script2.sql,..
but it doesn't work.
To do this, we can create an shell script(Unix ) or an bat file(Window). The content of the file is just commands to run scripts we need.
The syntax is:
mysql -uusername -ppassword -D database_name < script
For ex:
below is a shell script to run script1.sql, script2.sql, script3.sql in sequence automatically. This
mysql -u root -ppassword -D shopping < c:/script1.sql
mysql -u root -ppassword -D shopping < c:/script2.sql
mysql -u root -ppassword -D shopping < c:/script3.sql
From now, to create database, the only thing we need is to run this bat file or shell script file.
0 comments:
Post a Comment