Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-127

Let the connector accept None passwords.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.0.4
    • 1.0.5
    • Generic
    • None
    • MariaDB 10.5
      Python 3.6
      CentOS 7.8

    Description

      When migrating from the mysql to the mariadb connector, I found out, that when using the socket user identification from 10.5 the password is not ignored.
      So an extra if block is needed to connect to the server.
      using the mysql connector, this code will work:

      db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path,database="mysql")
      

      But for the mariadb connector it must changed to:

      if root_pw:
                              db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path, database="mysql")
      else:
                              db_connection = db_connector.connect(user="root",unix_socket=socket_path, database="mysql")
      

      When connect via socket auth, the password will be None, because it is not needed. But the mariadb python module can't handle it. The connect will fail with:

      TypeError: connect() argument  4 must be str, not None
      

      Attachments

        Activity

          People

            georg Georg Richter
            mariaTux Frank
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.