mysql1_dart
mysql1_dart copied to clipboard
SocketException: Socket has been closed
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 ?
where did u add default_authentication_plugin=mysql_native_password
@iammohsinar