DBD-mysql
DBD-mysql copied to clipboard
add DBD::mysql::client_version() to have the client version without DB connections
trafficstars
The value of mysql_get_client_version() is available via $dbh->{clientversion}, but it would be nicer if we can get the client library version without DB connections; For example, one would like to add or remove mysql_skip_secure_auth=1 to the dsn according to the client library version.
(edited)
As @miyagawa said, the following trick works as well:
$ perl -E 'use DBI; say(DBI::_new_dbh(DBI->driver("dbi:mysql:"))->{mysql_clientversion});'
80028