Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line syntax for script

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

MySQL newbie so please be gentle [smile]

Have a script that creates and populates a table which will execute via the EMS MySQL Mnager Lite interface if you open the database 'test' and run the *.sql script.

The *.sql script is located in the 'data' folder which is the parent folder of 'test'.

Having opened the database 'test' through the command line, what is the correct syntax to run the script, please?

TIA

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.net
PDFcommandertm.com
 
If you want to run a SQL file from the command line, you can do:
[tt]
mysql [-u username] [-ppassword] [-h host] [database] <sqlfile.sql
[/tt]
 
You need to run the command I gave from the shell command line. I don't know of any way to run external SQL files from within mysql.
 
You don't have to put the file into mysql/bin. You can specify a full file path, e.g. "<d:/mydir/mycommands.sql
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top