how to check mysql daemon from a script, not via Telnet?

I want to run mysql (the client) and get a response about the status of the server, connectivity, or a problem report.
Starting mysql when there is no root access, you can get the answer
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
It's all good, I'll read the answer, raspers it and say the mysql server is running, access to root without a password is forbidden.
If I had access then I move to online mode, as it does not go into interactive mode and just get the connection status.
Well, if not the mysql I will answer that you have not installed the mysql client
October 8th 19 at 02:48
3 answers
October 8th 19 at 02:50
mysql -e "show status"
October 8th 19 at 02:52
echo quit|mysql -u root-ppass
or mysql-u root-ppass -e quit - Violet_Wiso commented on October 8th 19 at 02:55
October 8th 19 at 02:54
mysqlstatus still there specifically for what you want

Find more questions by tags MySQL