title: Accessing MySQL from Python 3: Access denied for user
body: <p>I tried to access MySQL from Python 3.3 with the following methods:</p>
  
  <pre><code>import mysql.connector
  
  config = {
    'user': '###',
    'password': '******',
    'host': '##.##.#.##',
    'database': '########',
    'port': '####',
    'raise_on_warnings': True,
  }
  
  cnx = mysql.connector.connect(**config)
  
  cnx.close()
  </code></pre>
  
  <p>but when I ran the above code, I got this error:</p>
  
  <pre><code> mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user '###'@'##.##.#.###' (using password: YES);
  </code></pre>
  
  <p>Why am I getting this error, and how can I fix it?</p>