Monday, 2 September 2013

Entering data into a textfile from mysql using scripts

Entering data into a textfile from mysql using scripts

I have written a script to extract the contents of a table into a
textfile. this is my code
#!/bin/bash
mysql -uroot -ppasswd database select * from table>textfile.txt
i have changed permissions on the file and when i run it using ./myscript
it creates textfile.txt but loads into it the mysql manual.How can i
achieve my desired result. I am using Linux cli

No comments:

Post a Comment