Shell Scripting question

Roger McCalman roger at
Thu Apr 15 11:03:34 BST 2004

On Thu, Apr 15, 2004 at 10:55:08AM +0100, Dave Tiger wrote:
> Thanks Rodger for the info. Perl DBI is not an option at the moment but I
> might go down that road if need be.
> Sorry to be a bore but where in the string do I put the required -u -h -p
> parts for the MySql connection ?

Anywhere between the mysql and the database name, I prefer after the mysql i.e

mysql -u username -h dbhost -p password --skip-column-names --batch -e 'select ...' database | 

but I prefer not to put the password on the command line but to use mysql's
access control based on user and host. You can also use the my.cnf to set
defaults. man mysql also explains the other options.

Cheers, Roger (without a d)

More information about the Ukfreebsd mailing list