title: How to connect to MariaDB by means of python?
body: <p>I am trying to retrieve some data from a MariaDB server (located in a different network).
  I can access the server via phpmyadmin but I cannot connect to it by means of a python script.
  Following <a href="https://mariadb.com/resources/blog/how-to-connect-python-programs-to-mariadb/" rel="nofollow noreferrer">MariaDB documentation</a> I wrote the following Python code:</p>
  <pre><code># Module Imports
  import mariadb
  import sys
  
  # Connect to MariaDB Platform
  try:
      conn = mariadb.connect(
          user=&quot;myUSER&quot;,
          password= &quot;myPSW&quot;,
          host=&quot;localhost&quot;
          port=3306,
          database=&quot;myDATABASE&quot;
  
      )
  except mariadb.Error as e:
      print(f&quot;Error connecting to MariaDB Platform: {e}&quot;)
      sys.exit(1)
  
  # Get Cursor
  cur = conn.cursor()
  </code></pre>
  <p>This is not working and I get the following error:</p>
  <pre><code>Error connecting to MariaDB Platform: Can't connect to MySQL server on 'localhost' (10061)
  Process finished with exit code 1
  </code></pre>
  <p>I retrieved MariaDB infos from here:</p>
  <p><a href="https://i.stack.imgur.com/gZTb3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gZTb3.jpg" alt="enter image description here" /></a></p>
  <p>Am I missing some important point?</p>