web analytics
Skip to primary content
Skip to secondary content

MemoSoup

Mix of the things I always forget

MemoSoup

Main menu

  • Home
  • About
  • Links

Tag Archives: script

MySQL: start SQL from shell script

Posted on 18/09/2009 by bigspoon
Reply

The following code starts the SQL from the shell script directly, without additional SQL file

#!/bin/sh
--/. &> /dev/null; exec mysql "$@"

select 'Hello, world!' as test ;

The detailed explanation of the trick is here

Posted in mysql | Tagged mysql, script, start | Leave a reply

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress