mysql1_dart icon indicating copy to clipboard operation
mysql1_dart copied to clipboard

SocketException: Socket has been closed

Open iammohsinar opened this issue 4 years ago • 2 comments

Flutter 2.5.1 mysql 8.0.26

void main() {
  getConnection();
}

void getConnection() async {
  var settings = ConnectionSettings(
      host: '192.168.31.201',
      port: 3306,
      user: 'flutter_user',
      db: 'flutter_demo_desktopapp',
      password: 'rootroot');
  MySqlConnection conn = await MySqlConnection.connect(settings);
  Results i = await conn.query('select name from my_users');
  print(i);
}

i was getting SocketException: Socket has been closed or Error 1156 (08S01): Got packets out of order exception from above code so i solved this by adding

[mysqld]
default_authentication_plugin=mysql_native_password

in my.cnf found in homebrew(mysql) /usr/local/etc/ why i don't get proper exception Error: Authentication plugin not supported: caching_sha2_password as galileo_mysql throws ?

iammohsinar avatar Oct 02 '21 19:10 iammohsinar

where did u add default_authentication_plugin=mysql_native_password

wanoghoco avatar Dec 25 '22 19:12 wanoghoco

@iammohsinar

wanoghoco avatar Dec 25 '22 19:12 wanoghoco