title: How to get Python MYSQL connection username and password?
body: <p>I have installed spyder with anacoda for python 3.7 version for windows. Then if I <code>print("hello")</code>, it works fine.</p>
  
  <p>Now I want to connect with MYSQL database so I have installed python drivers to communicate with MYSQL. Using Anaconda Prompt I have run below command:</p>
  
  <pre><code>conda install -c anaconda mysql-connector-python
  </code></pre>
  
  <p>I got message in Anaconda Prompt that packages installed successfully. I don't know how to get username and password to connect with MYSQL? I have already checked that MYSQL installed properly using <code>import mysql.connector</code>.</p>
  
  <p>Code as per below:</p>
  
  <pre><code>import mysql.connector
  from mysql.connector import Error
  def connect():
     try:
         conn = mysql.connector.connect(host='127.0.0.1',
                                     user='',
                                     passwd='')
  
         if conn.is_connected():
             print('Connected to MySQL database')
  
     except Error as e:
         print(e)
  connect()
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>2003: Can't connect to MySQL server on '127.0.0.1:3306' (10061 No connection could be made because the target machine actively refused it)
  </code></pre>