lua-resty-mysql
lua-resty-mysql copied to clipboard
provide a method to ping the server
MySQL ping method/query could let us know in advance before executing a query if the server is reachable and in good state. The feature request is to add this ping method on a db object which returns err to say whether it was success or failure.
@bhaisaab Patches welcome! :)
How about using
str = db:server_ver()
If it return a version that indicates server is available
@maanas That won't work since server_ver simply reads the version data in the initial handshake (if any) while establishing a new MySQL connection. There is no new communications with the MySQL server upon each server_ver call.