Peng Yu Why the same command have different results when it is in a bash script and when it is not?
Oct 09, 2011; 17:19
Peng Yu
Why the same command have different results when it is in a bash script and when it is not?
Hi,
It is seems strange to me why the same command "mysql -hlocalhost -uxxx" when it is run from the command line, it will show an error. When it is run in a bash script, it runs fine. I guess this might be described somewhere, but I'm yet to find the answer. Does anybody know why this happens and how to make the command line version working?
~$ mysql -hlocalhost -uxxx ERROR 1045 (28000): Access denied for user 'xxx'@'localhost' (using password: YES) ~$ cat `which mysqllocalhostxxx.sh ` #!/usr/bin/env bash
mysql -hlocalhost -uxxx ~$ mysqllocalhostxxx.sh Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 101 Server version: 5.5.9 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
-- Regards, Peng
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Oct 10
Rik Wasmus Re: Why the same command have different results when it is in a bash script and when it is not?
Oct 10, 2011; 12:00
Rik Wasmus
Re: Why the same command have different results when it is in a bash script and when it is not?
Oct 11
Johan De Meersman Re: Why the same command have different results when it is in a bash script and when it is not?
Oct 11, 2011; 10:16
Johan De Meersman
Re: Why the same command have different results when it is in a bash script and when it is not?
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!