diff --git commands/sql/sql.drush.inc commands/sql/sql.drush.inc
index d28284e..4f0ed16 100644
--- commands/sql/sql.drush.inc
+++ commands/sql/sql.drush.inc
@@ -470,10 +470,22 @@ function _drush_sql_get_credentials($db_spec = NULL) {
 
   switch (_drush_sql_get_scheme($db_spec)) {
     case 'mysql':
-      $cred = ' -h' . $db_spec['host'] .
-         (empty($db_spec['port']) ? '' : ' -P' . $db_spec['port']) .
-         ' -u' . $db_spec['username'] .
-         (empty($db_spec['password']) ? '' : ' -p' . $db_spec['password']) . ' ' . $db_spec['database'];
+      $conf = tempnam(sys_get_temp_dir(),"my.cnf");
+      $fh = fopen($conf, "w");
+      fwrite($fh, "[client]\n");
+      fwrite($fh, "user = ".$db_spec['username']."\n");
+      if(!empty($db_spec['password'])) {
+        fwrite($fh, "pass = ".$db_spec['password']."\n");
+      }
+      if(!empty($db_spec['port'])) {
+        fwrite($fh, "port = ".$db_spec['port']."\n");
+      }
+      fwrite($fh, "host = ".$db_spec['host']."\n");
+      fclose($fh);
+
+      register_shutdown_function("_drush_sql_tmp_cleanup", $conf);
+
+      $cred = " --defaults-file=$conf " . $db_spec['database'];
       break;
   case 'pgsql':
       $cred = (isset($db_spec['database']) ? ' -d ' . (empty($db_spec['database']) ? 'template1' :  $db_spec['database']) : '') .
@@ -490,6 +502,12 @@ function _drush_sql_get_credentials($db_spec = NULL) {
   return escapeshellcmd($cred);
 }
 
+function _drush_sql_tmp_cleanup($file = NULL) {
+  if(!empty($file) && file_exists($file)) {
+    unlink($file);
+  }
+}
+
 function _drush_sql_get_invalid_url_msg($db_spec = NULL) {
   if (is_null($db_spec)) {
     $db_spec = _drush_sql_get_db_spec();
