Unable to solve error - SocketException: Socket has been closed
I'm making a mySql connection with dard but I aways getting this error:
Unhandled exception: SocketException: Socket has been closed
to this code below:
`import 'dart:async'; import 'package:mysql1/mysql1.dart';
class Connect {
Future conection() async { final conn = await MySqlConnection.connect(ConnectionSettings( host: '', port: 3306, user: '', db: '', password: '', useCompression: false, useSSL: false, timeout: const Duration(seconds: 20)));
return conn;
}
}
Does someone knows how to fix it?
In this code I return conn because I use it in another class that finds my query, that I'm making in a dynamic way.
I have the same issue after my hosting partner has updated to mysql8 yesterday. Please help.
I have tried all mysql libraries for Flutter. However, all of them no longer work. You can no longer run a query. Either you get the socket closed, socket reset or out of order error. Very frustrating.
Unfortunately, not a single repository has been updated for years...
I hope mysql1 can be a forerunner.
Any update on this?
The latest MySQL docker image is pointing to 8.4.0, and this is breaking connections.