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 · 1 comment
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.

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

2 participants