P
P
Puma Thailand2012-02-28 14:00:00
MySQL
Puma Thailand, 2012-02-28 14:00:00

how to check mysql daemon from script, not telnet?

I want to start mysql (client) and get a response about the status of the server, connectivity, or a message about a problem.
Starting mysql when there is no access for root, you can get the response
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
That's all right, I'll read the answer, parse it and say the mysql server is running, access to root without a password is prohibited.
If I got access, then I go into interactive mode, no matter how I go into interactive mode, but just get the connection status.
Well, if there is no mysql itself, I will answer that mysql client is not installed

Answer the question

In order to leave comments, you need to log in

3 answer(s)
@
@sledopit, 2012-02-28
_

mysql -e "show status"

A
Andrey Burov, 2012-02-28
@BuriK666

echo quit|mysql -u root -ppass

M
Maxim, 2012-02-29
@maxout

mysqlstatus is there specifically for what you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question