diff --git a/resources/lib/storemysql.py b/resources/lib/storemysql.py index c2fd7c7..5bddd1c 100644 --- a/resources/lib/storemysql.py +++ b/resources/lib/storemysql.py @@ -66,12 +66,22 @@ def init(self, reset=False, convert=False): if reset: self.logger.warn('Reset not supported') try: - self.conn = mysql.connector.connect( - host=self.settings.host, - port=self.settings.port, - user=self.settings.user, - password=self.settings.password - ) + # TODO Kodi 19 - we can update to mysql connector which supports auth_plugin parameter + try: + self.conn = mysql.connector.connect( + host=self.settings.host, + port=self.settings.port, + user=self.settings.user, + password=self.settings.password + ) + except Exception: + self.conn = mysql.connector.connect( + host=self.settings.host, + port=self.settings.port, + user=self.settings.user, + password=self.settings.password, + auth_plugin = 'mysql_native_password' + ) try: cursor = self.conn.cursor() cursor.execute('SELECT VERSION()')