You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
classMysql {
// Note: if you are using terminal base connection than localhost is 127.0.0.1// Note if you are using fluter Emulator than localhost connection address is 10.0.2.2staticString host ='10.0.2.2',
user ='root',
// Note:- I am not using any password in my database// password = "123456789",// Database name that i created inside mySQL (Which should already exited)
db ='profiles';
// Note:- MySQL sever portstaticint port =8080;
Mysql();
Future<MySqlConnection> getConnection() async {
var settings =ConnectionSettings(
host: host,
port: port,
user: user,
// password: password,
db: db,
);
returnawaitMySqlConnection.connect(settings);
}
}
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);
}
`
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
The text was updated successfully, but these errors were encountered: