I am writing a shell script to run a sql select query using mysqlsh.
So I had some issues and I found that I need to use "\sql" to change it from
mysql-js> to mysql-sql>
I need to run /sql before I run the query from a file.
"C:\mysql-shell-1.0.11-windows-x86-64bit\bin\mysqlsh.exe" echo \sql | mysql://user@IP:PORT?schema=SCHEMANAME&password=PASSWORD
and then execute this to run the select query and save it to a tmpfile.txt
"C:\mysql-shell-1.0.11-windows-x86-64bit\bin\mysqlsh.exe" --file "$EDIR"/data/tmp.sql > "$EDIR"/data/tmpfile.txt 2>&1
I am not sure what am missing. I tried different alternatives,
I am getting the below error on the first line "data_extractss.sh: line 53: mysql://user@IP:PORT?schema=SCHEMANAME&password=PASSWORD: No such file or directory"
Any suggestion is appreciated.
"C:\mysql-shell-1.0.11-windows-x86-64bit\bin\mysqlsh.exe" echo \sql | "mysql://user@IP:PORT?schema=SCHEMANAME&password=PASSWORD"