List:General Discussion« Previous MessageNext Message »
From:Ehrwin Mina Date:July 29 2005 7:49am
Subject:Re: mysql command line execution
View as plain text  
Jeff,


You can make a shell script or a php script or a perl script by that way 
you can hide the commands you need to execute.

eg.

Make a shell script (myshell.sh)


#!/bin/sh

myuser=dbuser
mypasswd=dbpassword
mydb=dbname
myhost=localhost
myport=3306

db1=mysql -u$myuser -pmypasswd -Dmydb -h$myhost -P$myport

echo "repair table employee" | $db1
echo "unlock table " | $db1

exit


2. Grant the user for its privileges.
3. change the permission of the file.
4. run the shell like this

 > sh myshell.sh


At 10:09 AM 7/29/2005, 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
>
>--
>Jeff Richards
>Consulting Architect
>Openwave Systems Asia Pacific
>+61 415 638757
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Thank you,

Ehrwin C. Mina

9/F Tower 2
RCBC Plaza
6819 Ayala Avenue cor. Sen. Gil J. Puyat Avenue
Makati City 1200 Philippines

Cell       (63 918) 930 4383
            (63 917) 845 2102
Tel        (63 2) 757 2630/32
Fax        (63 2) 757 2633
Email      ehrwin@stripped
Web        www.chikka.com

This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, 
you must not copy this message or attachment or disclose the contents to 
any other person. If you have received this transmission in error, please 
notify the sender immediately and delete the message and any attachment 
from your system. Chikka does not accept liability for any omissions or 
errors in this message which may arise as a result of E-Mail-transmission 
or for damages resulting from any unauthorized changes of the content of 
this message and any attachment thereto. Chikka does not guarantee that 
this message is free of viruses and does not accept liability for any 
damages caused by any virus transmitted therewith.


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