| | 153 | Let's write the list of runs into a file. There are plenty of options. Here are a few (assuming the query is in a file query.sql) |
| | 154 | {{{ |
| | 155 | mysql -N [...] < query.sql > Crab.txt |
| | 156 | cat query.sql | mysql -N [...] > Crab.txt |
| | 157 | rootifysql [...] -n -v0 -d query.sql > Crab.txt |
| | 158 | rootifysql [...] -n -w Crab.txt query.sql |
| | 159 | }}} |
| | 160 | |
| | 161 | The [...] is placeholder for additional options, in particular the login credentials (ideally they are kept in a file which can not be read by everyone). |
| | 162 | |
| | 163 | An alternative is to put |
| | 164 | {{{ |
| | 165 | #!/path/to/rootifysql --config=/path/to/resources.rc |
| | 166 | }}} |
| | 167 | in the first line of your query.sql. Make it executable "{{{chmod u+x query.sql}}}" and put your credentials (uri=) into resources.rc. Now you can call it directly |
| | 168 | {{{ |
| | 169 | query.sql -n -w Crab.txt |
| | 170 | }}} |
| | 171 | |
| | 172 | |