• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Batch File & MySQL

New Here ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

I am using CFExecute to launch a batch file to interact with another application via the command line. Within the batchfile I would like perform some logic and one set is to Update a record in MySQL database. Basically what I want to do is something like this but I know this is the right syntax.

C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQL.exe" -u root -p123456
USE: MyDataBase;
UPDATE candidatejobboard SET SubmissionStatus=3 WHERE JobBoardSubmissionID=39;

TOPICS
Advanced techniques

Views

342

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 15, 2007 Sep 15, 2007
Somewhere in there you need a connect string. I don't know how to do it with windows/MySql, but I'll show you how to do it with unix/redbrick. It might illuminate a light bulb over someone's head.

echo "
your sql goes here
" | risql -d database_name user_name password 2> file_of_your_choice

in that example, risql is the program that connects to the db.

Votes

Translate

Translate
LEGEND ,
Sep 15, 2007 Sep 15, 2007

Copy link to clipboard

Copied

Somewhere in there you need a connect string. I don't know how to do it with windows/MySql, but I'll show you how to do it with unix/redbrick. It might illuminate a light bulb over someone's head.

echo "
your sql goes here
" | risql -d database_name user_name password 2> file_of_your_choice

in that example, risql is the program that connects to the db.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 15, 2007 Sep 15, 2007

Copy link to clipboard

Copied

LATEST
Dan,

Thanks for the feeback you got me in the right direction. For anyone that needed the final solution it was
"C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQL.exe" -u root -pt12345 -e "UPDATE candidatejobboard SET SubmissionStatus=2 WHERE JobBoardSubmissionID=39" test

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation