The title is rewritten as: "Flutter mysql1 received out-of-order packets"
P粉333395496
P粉333395496 2023-11-05 22:34:25
0
1
678

I'm having some issues setting up a connection to my VPS using flutter'smysql1library. When I executed the query, I encountered this errorUnhandled Exception: Error 1156 (08S01): Got packets out of order.

MySQL server version: 8.0.28

This is the service I use to establish a connection to the database.

var settings = ConnectionSettings( host: 'MY_ADDRESS', port: 3306, user: 'root', password: 'MY_PASSWORD', db: 'MY_DATABASE' ); Future connect() async { return await MySqlConnection.connect(settings); }

Then I try to retrieve the user information another way in another method:

var connection = await mysqlService.connect(); var res = await connection.query('select name from users'); await connection.close();

The problem occurs in the connection.query function, which generates the error:

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Error 1156 (08S01): Got packets out of order #0 Handler.checkResponse package:mysql1/…/handlers/handler.dart:77 #1 QueryStreamHandler.processResponse package:mysql1/…/query/query_stream_handler.dart:50 #2 ReqRespConnection._handleData package:mysql1/src/single_connection.dart:349 #3 ReqRespConnection._handleHeader package:mysql1/src/single_connection.dart:318  #4 ReqRespConnection._readPacket package:mysql1/src/single_connection.dart:303 

I'm not sure if this is a database issue on my VPS or something else.

P粉333395496
P粉333395496

reply all (1)
P粉805107717

This package seems to have issues on MySQL 8.

Try to use mysql_client, this helps me.

https://pub.dev/packages/mysql_client

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!