Open
Description
I am trying to send a single value to mysql DB but I am keep getting these errors.
So first of all this is my code:
`
var settings = new ConnectionSettings(
host: 'localhost',
port: 3306,
user: 'flutter_admin',
password: 'flutter_admin_password',
db: 'romicp'
);final conn = await MySqlConnection.connect(settings);
var result = await conn.query( 'insert into bluetoothvalues (taha) values (?)',
[3.66]);
print('Inserted row id=${result.insertId}');
}
`
With this code, I get this error: Unhandled Exception: SocketException: Connection refused.
So I was looking for solutions and i found out that this question was asked before and it was fixed by changing 'localhost' to ''10.0.2.2'' or your IPaddress. both ways gave me another error which is: Connection timed out, host:
Please anyone can help
Metadata
Metadata
Assignees
Labels
No labels