save mysql sqery output into txt file
You just need to modify the query and login credential then run the below command of database server .
mysql -e “select * FROM tabledata” -u satya -pPrakash databasename > /home/ob_cdr.txt
However i have written a shell script to do this job.
#!/bin/bash
USER=”root”
PASSWORD=”rootpassword”
#OUTPUT=”/home/ftpbackup/”
OUTPUT=”/root/”
rm “$OUTPUTDIR/*txt” > /dev/null 2>&1
databases=`mysql –user=$USER –password=$PASSWORD -e “SHOW DATABASES;” | tr -d “| ” | grep -v Database`
for db in $databases; do
if [[ “$db” = “databasename” ]] ; then
echo “Dumping cdr table of database: $db”
mysql -e “SELECT * FROM tablename ” -u root -pROOTPASSWORD asterisk > $OUTPUT/ob_cdr.txt
echo “Dumping database TABLE: $db”
fi
done
And then make the script executable.
I quite like reading through a post that will make men and
women think. Also, many thanks for allowing me to comment!
Inside your private Caribbean beach villa,
you can kick up your heels and relax in the plush surroundings.
Ignoring some of these rules will just make you look like a jerk and possibly leave you
humiliated. In a new media driven world, people rely on search,
their friends on social networks, and other online media channels
to hear about things happening in the digital world.
As the admin of this web page is working, no doubt
very rapidly it will be renowned, due to its feature contents.
Although you’re taking a risk, you can attempt this on your
own. Ignoring some of these rules will just make you
look like a jerk and possibly leave you humiliated. There are a total of nine unique habitats where you
may discover many different types of wildlife animals and over one hundred species
of birds that you may enjoy seeing while on your Florida vacation.
Hi to all, because I am really eager of reading this webpage’s post to be updated daily.
It carries fastidious stuff.
It’s going to be end of mine day, however before ending I am reading
this enormous piece of writing to improve my experience.
I believe everything said made a ton of sense. But, consider this, suppose
you were to write a awesome headline? I am not suggesting your content is not solid.,
but suppose you added a title to possibly grab a person’s attention? I mean save mysql sqery
output into txt file | Eduguru – Good Blogging is kinda plain. You might glance at Yahoo’s home page and note how they create post headlines to get people to open the links.
You might add a related video or a picture or two to get readers interested about what
you’ve got to say. Just my opinion, it might bring your blog a little bit more
interesting.
I just couldn’t go away your web site before suggesting that I actually loved the
standard information an individual supply in your guests?
Is going to be again often in order to inspect new posts
Pretty! This has been an incredibly wonderful post.
Many thanks for providing this information.
Hello, There’s no doubt that your site could possibly be having web browser compatibility
problems. When I take a look at your web site in Safari, it looks fine however, if
opening in I.E., it’s got some overlapping issues. I just wanted to give you a quick heads up!
Besides that, great site!
Pingback: URL
612664 37843[…]the time to read or visit the content or sites we have linked to below the[…]
I loved as much as you’ll receive carried out right
here. The sketch is attractive, your authored material stylish.
nonetheless, you command get got an edginess over that you wish be delivering the following.
unwell unquestionably come further formerly again as exactly the same nearly
a lot often inside case you shield this hike.
If you wish for to grow your familiarity only keep visiting
this website and be updated with the latest news posted here.
my page … dolci
My brother suggested I might like this web site.
He used to be entirely right. This submit truly
made my day. You can not imagine simply how much time I
had spent for this information! Thanks!
If some one needs expert view on the topic of running a blog
after that i recommend him/her to visit this webpage, Keep
up the nice job.
Currently it appears like WordPress is the preferred blogging platform out there right now.
(from what I’ve read) Is that what you’re using on your blog?
It’s remarkable in favor of me to have a web page, which is valuable designed for my experience.
thanks admin
Hi there very cool site!! Man .. Beautiful ..
Amazing .. I’ll bookmark your site and take the feeds
additionally? I am happy to seek out so many helpful information right
here in the post, we need work out extra strategies on this regard, thank you for sharing.
. . . . .
Way cool! Some extremely valid points! I appreciate you writing this article and the rest of the site is really good.
Greetings from Florida! I’m bored at work so I decided to browse your blog on my iphone during lunch
break. I love the knowledge you present here and can’t wait to
take a look when I get home. I’m shocked at how fast your blog loaded on my cell
phone .. I’m not even using WIFI, just 3G ..
Anyhow, good site!