MySQL Forums
Forum List  »  General

mysql command-line variables
Posted by: Foo Bar
Date: October 06, 2010 12:02PM

I need a way to pass in a variable from the mysql command. In PostgreSQL I can do something like 'psql -U foo -v DBVAR=bar' and inside the PG shell I can reference the value set for DBVAR. Is something like this possible with the 'mysql' command?

Or is it possible to perhaps use the 'source' command to set the value of a mysql @var from doing something like @var = '\! env | grep bar'.

Options: ReplyQuote


Subject
Written By
Posted
mysql command-line variables
October 06, 2010 12:02PM
October 10, 2010 04:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.