List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:July 29 2005 7:11am
Subject:Re: mysql command line execution
View as plain text  
Jeff Richards wrote:

> Hi,
> 
> Is there a secure way of running mysql commands against the db from the
> command line, or in some kind of secure batch mode, without making the
> password totally visible? We need to procedurize things like "flush
> tables with read lock", "unlock tables" etc. Is making the password
> visible on the command line the only way?
> 
> Thanks,
> 
> Jeff

No, you can put the mysql user and password in an option file (usually 
.my.cnf).  Of course, you'll make this file readable only by the user running 
the job.  You'll need at least

   [client]
   user=mysql_username
   password="my_password"

in the file.  Actually, you can leave out the "user=..." line if the mysql 
user and the unix user are the same.

For the details, see the description of option files in the manual 
<http://dev.mysql.com/doc/mysql/en/option-files.html>.

Michael
Thread
mysql command line executionJeff Richards29 Jul
  • Re: mysql command line executionBruce Dembecki29 Jul
  • Re: mysql command line executionMichael Stassen29 Jul
  • Re: mysql command line executionEhrwin Mina29 Jul
    • Re: mysql command line executionMichael Stassen29 Jul
      • Re: mysql command line executionNuno Pereira29 Jul
        • Re: mysql command line executionMichael Stassen29 Jul
          • Re: mysql command line executionNuno Pereira29 Jul
            • Re: mysql command line executionJason Pyeron29 Jul
              • Re: mysql command line executionNuno Pereira1 Aug
        • Re: mysql command line executionJoerg Bruehe29 Jul
        • Re: mysql command line executionEhrwin Mina1 Aug
          • Re: mysql command line executionEugene Kosov1 Aug
            • RE: mysql command line executionEdwin Cruz1 Aug
              • Re: mysql command line executionNuno Pereira1 Aug
Re: mysql command line executionNuno Pereira2 Aug
Re: mysql command line executionNuno Pereira3 Aug