'Connect to MySQL server for client failed

I'm writing an application to upload data for my customer's database. When I tested it on my PC, it works ok but when connecting to the client's database, it has some errors. I'm using this code to connect to MySQL:

    def connect_sql(self):
        mydb = mysql.connector.connect(
            host=host,
            passwd=pw,
            port=port,
            database=db,
            user=user,
        )
        return mydb

When tried to connect to the database on the client's PC, it shows this error:

   1115 (42000): Unknown character set: 'utf8mb4'

I've noticed that this error maybe because different database server version between me and my client. While he uses 5.0.67-community-nt (which does not support 'utf8mb4') and I use 10.0.21 MariaDB-log.

Is there any way to fix this error on my site (maybe export .sql file to set the default character set to prevent this error, etc..), or do I need to ask my customer to update his MySQL database's version?

Thanks for any help!!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source