Since the service instance is updated with adding more keys,
Mysql2::Error: Data too long for column 'credentials' should indicate column 'credentials' in database table has no space to store more keys.
By reviewing database table schema it's shown that 'credentials' column is defined as 'text' type, which can store up to 64KB (65536) chars
mysql> desc service_instances;
+-----------------------+----------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+----------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
......
| credentials | text | YES | | NULL | |
......
You might see the size of input data is less than 64 KB. However the content of input data will be encrypted and stored into 'credentials' column, which means the encrypted data size will be bigger than its original size. You can check the current length of 'credentials' column for problematic service instance. For example,
$ bosh -d cf-xxxx ssh mysql/0
$ sudo mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf ccdb
mysql> select id from service_instances where name='test';
+----+
| id |
+----+
| 45 |
+----+
mysql> select length(credentials) from service_instances where id=45;
+---------------------+
| length(credentials) |
+---------------------+
| 65516 |
+---------------------+
mysql> exit
Bye
Note: Do NOT run any other SQL statement to update data in databaseAs you can see the current length of is 'credentials' column in this example is 65516 bytes, which is very close to its capacity 65536 bytes. So adding even a few more data might reach to the 64KB capacity.
Since 64KB is a hard limit of 'credentials' column with current design, it can't be changed through configuration parameter. So the solution for the issue is either creating a new user-provided service instance or deleting some unused keys from existing service instance.