zim32 / mysql.dart

MySQL client for Dart written in Dart
BSD 3-Clause "New" or "Revised" License
64 stars 17 forks source link

TimeoutException #15

Closed emre13k closed 2 years ago

emre13k commented 2 years ago

E/flutter (13703): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: TimeoutException after 0:00:05.000000: Future not completed E/flutter (13703): E/flutter (13703): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: MySQL error: Got timeout reading communication packets

its the error code using example. can anyone help me about this?

zim32 commented 2 years ago

Please make sure you can access you database. You can check it using telnet or console mysql client or whatever you like

emre13k commented 2 years ago

I can access my db using console.

mysql> select * from deneme.sehirler where id=1; +----+-------+ | id | name | +----+-------+ | 1 | adana | +----+-------+ 1 row in set (0.01 sec)

mysql>

zim32 commented 2 years ago

Hm. Maybe same as here? https://github.com/zim32/mysql.dart/issues/11

emre13k commented 2 years ago

it can be but ı don't know how can ı change. do you know?

zim32 commented 2 years ago

Try to connect to mysql from console, restart flutter app and check if issue still exists

emre13k commented 2 years ago

if I use my phone ip: Unhandled Exception: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 192.168.1.100, port = 54336

if I use my pc ip: Unhandled Exception: TimeoutException after 0:00:05.000000: Future not completed E/flutter (26589): E/flutter (26589): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: MySQL error: Got timeout reading communication packets

but if I use emulator and using 10.0.2.2 in the host it working.

I want to use my phone what shold ı do.

zim32 commented 2 years ago

You want to connect from your phone to what? Where is mysql server?

zim32 commented 2 years ago

Also check that you have Internet permission in your app

emre13k commented 2 years ago

mysql server is in my pc

emre13k commented 2 years ago

My app has a internet permission in the androidmanifest.xml

emre13k commented 2 years ago

When I use emulator its working but not working in my phone

zim32 commented 2 years ago

What exception you got when trying from your phone?

emre13k commented 2 years ago

if I write to host: "127.0.0.1"

I/flutter (15314): Connecting to mysql server... E/flutter (15314): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 32768

if I write to host: "192.168.1.103" //pc ip

I/flutter (15314): Connecting to mysql server... E/flutter (15314): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: TimeoutException after 0:00:05.000000: Future not completed E/flutter (15314): E/flutter (15314): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: MySQL error: Got timeout reading communication packets

zim32 commented 2 years ago

As I understand you phone and PC are in the same wifi network. And your mysql server is listening on 0.0.0.0 address (not 127.0.0.1)?

emre13k commented 2 years ago

As I understand you phone and PC are in the same wifi network. ---> yes And your mysql server is listening on 0.0.0.0 address (not 127.0.0.1)? ---> I don't know

zim32 commented 2 years ago

You must find listen directive in your mysql config file and make sure it is set to 0.0.0.0

emre13k commented 2 years ago

where can I find this

zim32 commented 2 years ago

What operation system?

emre13k commented 2 years ago

windows 10

zim32 commented 2 years ago

There should be my.ini or my.cfg file in mysql directory. You can read official mysql documentation

emre13k commented 2 years ago

I didn't find anything. the problem will be something else ı guess

zim32 commented 2 years ago

Can you try release 0.0.15 There was some fix, maybe your problem depends on that issue

zim32 commented 2 years ago

Possible duplicate of https://github.com/zim32/mysql.dart/issues/16