# MySQL Library BezierSQLib Not Working on New Computer

**URL:** <https://discourse.processing.org/t/mysql-library-beziersqlib-not-working-on-new-computer/40439>\
**Category:** Libraries\
**Created:** [January 4, 2023, 5:36am UTC](https://discourse.processing.org/t/mysql-library-beziersqlib-not-working-on-new-computer/40439 "2023-01-04T05:36:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![feltron](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/feltron/32/17762_2.png) [@feltron](https://discourse.processing.org/u/feltron)\
**Post date:** [January 4, 2023, 5:36am UTC](https://discourse.processing.org/t/mysql-library-beziersqlib-not-working-on-new-computer/40439/1 "2023-01-04T05:36:23Z")

</div>

I have used the BezierSQLib library for years to connect Processing to a local MySQL library. I recently moved to a new silicon Mac and installed a recent MySQL build. I believe that there is an incompatibility with the library and the new version of MySQL.

This code that was running fine on my other machine is now giving an error:

```auto
import de.bezier.data.sql.*;

MySQL msql;
String user = "root";
String pass = "password";
String database = "BAR01";
String query = "select dayofyear(startTime), startTime, duration from sleep order by startTime ";
int DayOfYear[] = new int[0];
String StartTime[] = new String[0];
int Duration[] = new int[0];

void setup() {
  size(300, 300);
  fetchData();
}

void fetchData() {
  msql = new MySQL( this, "localhost", database, user, pass );
  if (msql.connect()) {
    msql.query(query);
    println(query);
    while ( msql.next () ) {
      DayOfYear = append(DayOfYear, msql.getInt(1));
      StartTime = append(StartTime, msql.getString(2));
      Duration = append(Duration, msql.getInt(3));
    }
  }
}

```

Now it produces this error:

```auto
SQL.connect(): Could not connect to the database ( jdbc:mysql://localhost/BAR01 ).
java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

```

I believe that there is a character set incompatibility. I have tried to resolve this by adding parameters to the database field, like this, but they have not been successful.  
`String database = "BAR01?characterEncoding=latin1";`

I have also read that upgrading the MySQL Connector in the library could alleviate the issue, but I don’t know whether it’s possible to update the library.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![fjenett](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fjenett/32/18_2.png) [@fjenett](https://discourse.processing.org/u/fjenett)\
**Post date:** [January 8, 2023, 2:21pm UTC](https://discourse.processing.org/t/mysql-library-beziersqlib-not-working-on-new-computer/40439/2 "2023-01-08T14:21:43Z")

</div>

Just updated and minimally tested on 3.x and 4.x (both on Mac M1) with latest MySQL. Download from here:

[https://github.com/fjenett/sql-library-processing/raw/latest/release/BezierSQLib.zip](https://github.com/fjenett/sql-library-processing/raw/latest/release/BezierSQLib.zip)

---

<div class="post-metadata">

**Author:** ![feltron](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/feltron/32/17762_2.png) [@feltron](https://discourse.processing.org/u/feltron)\
**Post date:** [January 8, 2023, 6:27pm UTC](https://discourse.processing.org/t/mysql-library-beziersqlib-not-working-on-new-computer/40439/3 "2023-01-08T18:27:04Z")

</div>

Fabulous Florian - thank you for your help.  
This has resolved the issue perfectly.
