diff --git a/lib/cmd/handshake/client-capabilities.js b/lib/cmd/handshake/client-capabilities.js
index <HASH>..<HASH> 100644
--- a/lib/cmd/handshake/client-capabilities.js
+++ b/lib/cmd/handshake/client-capabilities.js
@@ -48,7 +48,7 @@ module.exports.init = function (opts, info) {
     capabilities |= Capabilities.DEPRECATE_EOF;
   }
 
-  if (opts.database) {
+  if (opts.database && info.serverCapabilities & Capabilities.CONNECT_WITH_DB) {
     capabilities |= Capabilities.CONNECT_WITH_DB;
   }
[misc] ensure that connecting to database only if server has capability