title: "cryptography is required for sha256_password or caching_sha2_password"
body: <p>Good day. Hope your all are well. Can someone help me with fix this? </p>
  
  <p>I'm new to the MySQL environment. I'm trying to connect to MySQL Database remotely. I used the following python code and got this error.  </p>
  
  <pre><code>Print(e) = "cryptography is required for sha256_password or 
               caching_sha2_password"
  </code></pre>
  
  <p>And have no idea how to solve the error.</p>
  
  <pre><code>import pymysql as db
  
  HOST = "XXXXX.XXX.XX”
  PORT = XXXX
  USER = "my_username"
  PASSWORD = "my_password”
  DB = "db_name"
  
  try:
      connection = db.Connection(host=HOST, port=PORT,user=USER,                 
      passwd=PASSWORD, db=DB)
  
      dbhandler = connection.cursor()
      dbhandler.execute("SELECT * from table_name")
      result = dbhandler.fetchall()
      for item in result:
          print (DB)
   except Exception as e:
      print(e)
  
  finally:
      connection.close()
  </code></pre>