Piping SQL commands from DCL

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

Piping SQL commands from DCL

Post by issinoho »

You can connect to MySQL using
$ mysql -umyacc -pmypwd database
or
$ mysql --user=myacc --password==mypwd database

If you need to execute a file within sql you can use the "source" command:
mysql> source file.sql

Or to pipe directly,
$ pipe mysql -uusername -ppassword database < file.sql
User avatar
chaos88
Posts: 3
Joined: Wed Nov 09, 2005 4:53 pm

Post by chaos88 »

Very kewl indeed.
It works a little different than usual pipe in VMS but it saved my a... and cured my headache.

I was actually trying to use mysqldump to backup the ... phpbb2 database. Yes I just got it running. I wish I can post a link here but is an intranet only site. :(

Anyways thanks for the article and if can add to it, it works for backup as well as I mentioned.

$ pipe mysqldump --opt database_name -u root -p > phpdb2_bak.sql

creates the phpbb2_bak.sql file which you can restore from using your command

Many thanks again,
chaos
Post Reply