SQL script files

Discussions around the use of MySQL on VMS
Post Reply
Message
Author
User avatar
issinoho
Site Admin
Posts: 202
Joined: Tue Feb 01, 2005 12:53 am
Location: Scotland
Contact:

SQL script files

#1 Post by issinoho »

When loading a database schema into MySQL on platforms such as Linux & Windows, the usual format is to redirect a SQL text file to the MySQL interpreter as follows,

mysql -u username -p database < file.sql

at which point it challenges the user for their password, and if correct the SQL file is processed.

On VMS, the limitations of the piping mechanism mean that this fails. However the following *does* work,

$ mysql -u username -p -e "source file.sql" database

Post Reply