Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to solve error - SocketException: Socket has been closed #157

Open
FernandoLucasDev opened this issue Mar 23, 2024 · 4 comments
Open

Comments

@FernandoLucasDev
Copy link

FernandoLucasDev commented Mar 23, 2024

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.

@gmpassos
Copy link
Contributor

Any update on this?

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

@CottonWhiteSheep
Copy link

Would like to ask if you manage to find a solution for this issue ?

@FernandoLucasDev
Copy link
Author

Not yet. I couldn't find a solution for this issue I faced. I just moved to use postgres SQL instead of mySql

@CottonWhiteSheep
Copy link

Thank you so much for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants