mysql1_dart icon indicating copy to clipboard operation
mysql1_dart copied to clipboard

Unable to solve error - SocketException: Socket has been closed

Open FernandoLucasDev opened this issue 1 year ago • 5 comments

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.

FernandoLucasDev avatar Mar 23 '24 13:03 FernandoLucasDev

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.

diinu avatar Mar 27 '24 18:03 diinu

Any update on this?

The latest MySQL docker image is pointing to 8.4.0, and this is breaking connections.

gmpassos avatar May 19 '24 01:05 gmpassos