Shell script calls mysql stored procedure _ MySQL

Source: Internet
Author: User
The shell script calls the mysql stored procedure bitsCN.com
#! /Bin/sh # The function of the script is used to balance statistics, we get # data from the table accseqs, after the analysis and calculation data, # the results will be inserted into the table acc_balances. # the script is executed at 1 o 'clock by every day. DIR = "/var/www/apps/SQL" DATE = $ (date + % Y % m % d -- date '1 days ago '?host=192.168.=95user=adminpasswd=00database=zhxtfile=result.txt cd $ {DIR} echo "the date: "$ {DATE} SQL =" exec mysql-h $ {HOST}-u $ {USER}-p $ {PASSWD}-D $ {DATABASE} -- default-character-set = utf8-e/"call query_balance ($ {DATE }) /"" echo $ {SQL }>$ {FILE} if mysql-h $ {HOST}/-u $ {USER}/-p $ {PASSWD}/-D $ {DATABASE}/-- default-character-set = utf8/-e "call query_balance ($ {DATE }) "; then echo" OK ">$ {FILE} else echo" fail ">>> {FILE} fiexit


BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.