title: MySQLConnection ERROR: Access denied for user 'rnd-admin'@'localhost' (using password: YES)
body: <p>I'm trying to connect to mysql database on remote server via ssh tunnel.<br>
  When the connection with server is established, my script fails with mysql error: </p>
  
  <pre><code>py.warnings - WARNING - /home/artur/Exposit/Projects/dataset-collector/venv/lib/python3.6/site-packages/paramiko/kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
    m.add_string(self.Q_C.public_numbers().encode_point())
  
  py.warnings - WARNING - /home/artur/Exposit/Projects/dataset-collector/venv/lib/python3.6/site-packages/paramiko/kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
    self.curve, Q_S_bytes
  
  py.warnings - WARNING - /home/artur/Exposit/Projects/dataset-collector/venv/lib/python3.6/site-packages/paramiko/kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
    hm.add_string(self.Q_C.public_numbers().encode_point())
  
  root - ERROR - 1045 (28000): Access denied for user 'rnd-admin'@'localhost' (using password: YES)
  Access denied for user 'rnd-admin'@'localhost' (using password: YES).
  </code></pre>
  
  <p><strong>Note:</strong>
  When I'm connecting to the database from terminal with the same credits using <code>mysql -u rnd-admin -p</code> then everything is fine, no errors detected, and mysql <strong>cli</strong> is opened.</p>
  
  <pre><code>        with SSHTunnelForwarder(
                  ('myhost', 22),
                  ssh_username="root",
                  ssh_password="passwd",
                  remote_bind_address=('127.0.0.1', 3306)) as tunnel:
              if tunnel.is_active:
                  db_config = read_db_config()
                  conn = MySQLConnection(**db_config)
  
                  cursor = conn.cursor()
                  cursor.execute(query)
                  result = cursor.fetchall()
  
                  conn.commit()
                  cursor.close()
                  conn.close()
  </code></pre>
  
  <p><strong>config.ini</strong></p>
  
  <pre><code>[mysql]
  host=127.0.0.1
  port=3306
  database=db-name
  user=rnd-admin
  password=pass
  </code></pre>