Skip to content
Back to formatted view

Raw Message

Message-ID: <21cebfe8-465f-c3aa-d71d-d1ae8b7886b5@shdawson.com>
Date: 2023-10-07T15:09:25Z
From: Stephen H. Dawson, DSL
Subject: Confirming MySQL Alive

Hi,


Getting some data from an older MySQL box. I had an event recently where 
the MySQL box went off-line for maintenance without a prior announcement 
of service disruption.

I decided to add a line on my local version of MySQL as I considered how 
to handle this condition going forward.

system("sudo systemctl status mysql", input = 
rstudioapi::askForPassword("sudo password"))

system("sudo systemctl status mysql",input=readline("Enter Password: "))


Both fail for the same reason, saying I need a terminal.


 > system("sudo systemctl status mysql", input = 
rstudioapi::askForPassword("sudo password"))
sudo: a terminal is required to read the password; either use the -S 
option to read from standard input or configure an askpass helper
sudo: a password is required
 >



 > system("sudo systemctl status mysql",input=readline("Enter Password: "))
Enter Password: ***REDACTED***
sudo: a terminal is required to read the password; either use the -S 
option to read from standard input or configure an askpass helper
sudo: a password is required
 >



I can run the code segments for things like ls and pwd. So, there is 
something unique about systemctl and R that is beyond my understanding 
today.

QUESTIONS
What is so special about systemctl and R in a system syntax statement?

What are some of the best practices to confirm a box I am hitting for 
data with R , either local or across the network, has MySQL up and running?


Thanks,
-- 
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com