Skip to content

Commit

Permalink
Mysql native password#136 (#151)
Browse files Browse the repository at this point in the history
* added mysql_native_password

* added parameter auth_plugin = 'mysql_native_password' for mysql

* added comment

* catch Exception

Co-authored-by: SB <[email protected]>
  • Loading branch information
codingPF and SB authored Apr 28, 2020
1 parent 8cfccdc commit a4ac9e8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions resources/lib/storemysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()')
Expand Down

0 comments on commit a4ac9e8

Please sign in to comment.