import mysql.connector
      
      mysql.connector.connect(host=hostname,
                              user=username,
                              passwd=password,
                              database=databasename,
                              charset='utf8mb4',
                              use_pure=True,
                              connection_timeout=10)
      
      Python language logo

      Connect to MySQL database

      -1

      24

      mysql
      database
      Python public recipes

      Connect to a MySQL database. use_pure uses te Python and not the pure C interface

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.