How to run a MYSQL script using a password from a command line? -


when try connect remote mysql database through command line works fine despite warning:

/sdzf => mysql -h db3  -u auser -ppassword db_6 -a warning: using password on command line interface can insecure. 

however, running script not work

/sdzf => mysql -h db3  -u auser -ppassword db_6 -a< findrec.sql warning: using password on command line interface can insecure. error 1045 (28000) @ line 1: access denied user 'auser'@'50.206.86.74'      (using password: yes) 

despite login statement included database name still needed point database first in sql script when running in batch mode:

use db_6;

if login first using same script "mysql -h db3 -u auser -ppassword db_6 -a" not need point database in sql.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -