SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func executeTestScript(){
  2. cmd := exec.Command("/usr/local/mysql/bin/mysql", "-h127.0.0.1", "-P3333", "-uusr", "-pPassxxx", "-Ddtb_test",  "< /Users/XXX/Documents/test/scripts/olds/SCRIPT_XXX.sql")
  3.  
  4. var out, stderr bytes.Buffer
  5.  
  6. cmd.Stdout = &out
  7. cmd.Stderr = &stderr
  8.  
  9. err := cmd.Run()
  10. if err != nil {
  11.     fmt.Println(fmt.Sprintf("Error executing query. Command Output: %+vn: %+v, %v", out.String(), stderr.String(), err))
  12.     log.Fatalf("Error executing query. Command Output: %+vn: %+v, %v", out.String(), stderr.String(), err)
  13.     }
  14. }
  15.    
  16. ERROR 1049 (42000): Unknown database '< /Users/XXX/Documents/test/scripts/olds/SCRIPT_XXX.sql'
  17.    
  18. /usr/local/mysql/bin/mysql --host=127.0.0.1 --port=3333 --user=usr --password=Passxxx --database=dtb_test < /Users/XXX/Documents/roseula/scripts/olds/SCRIPT_XXX.sql
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top