move db from mysql 5.6.51 to 8.0.26.
Posted by: Laurent Liegeois
Date: July 08, 2022 07:35AM

Hello,
I have a problem running a java application after copying the database from a mysql 5.6.51 to 8.0.26.
The error message is "java.sql.SQLException: Unknown character set index for field '255' received from server."

on the source database I do a dump(5.6.51) :
"mysqldump --defaults-extra-file=/home/dba/scripts/logindb.cnf db_name dbname > file.dump.sql"

on destination :

create database dbname CHARACTER SET latin1 COLLATE latin1_swedish_ci;"


All is ok but when I run the java application(I do not have the code source), I get an error message: "java.sql.SQLException: Unknown character set index for field '255' received from server."

I tried to put the same collation and charset, I did not succeed.


********source ********


mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 5.6.51 |
+-----------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES LIKE 'character\_set\_%';
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+--------+
7 rows in set (0.00 sec)

mysql> SELECT SCHEMA_NAME ,CATALOG_NAME, default_character_set_name, default_collation_name FROM information_schema.schemata where SCHEMA_NAME="FnTox_Dev";
+-------------+--------------+----------------------------+------------------------+
| SCHEMA_NAME | CATALOG_NAME | default_character_set_name | default_collation_name |
+-------------+--------------+----------------------------+------------------------+
| db name | def | latin1 | latin1_swedish_ci |
+-------------+--------------+----------------------------+------------------------+
1 row in set (0.00 sec)



******** destination ********
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.26 |
+-----------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES LIKE 'character\_set\_%';
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
+--------------------------+---------+
7 rows in set (0.00 sec)

mysql> SELECT SCHEMA_NAME ,CATALOG_NAME, default_character_set_name, default_collation_name FROM information_schema.schemata where SCHEMA_NAME="FnTox_Dev";
+-------------+--------------+----------------------------+------------------------+
| SCHEMA_NAME | CATALOG_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME |
+-------------+--------------+----------------------------+------------------------+
| db name | def | latin1 | latin1_swedish_ci |
+-------------+--------------+----------------------------+------------------------+
1 row in set (0.00 sec)

Translated with www.DeepL.com/Translator (free version)

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.