-
Notifications
You must be signed in to change notification settings - Fork 345
Connection error #1324
-
Hi guys. Please help me!!
while using this Connector in Xamarin.forms app. im getting exception like this ->>
MySqlConnector.MySqlException: 'Unable to connect to any of the specified MySQL hosts.'
im have been trying to fix this since 2 days, but i cant.
var builder = new MySqlConnectionStringBuilder
{
Server = "localhost",
Port = 3306,
UserID = "root",
Password = "root",
Database = "DemoProject",
Pooling = true,
};
var connection = new MySqlConnection(builder.ConnectionString);
connection.Open();
var command = connection.CreateCommand();
command.CommandText = "Insert into user(Id, Name, Password) values('1', 'www', 22222);";
var reader = command.ExecuteNonQuery();
this is simple code that i wrote.
im using Openserver MySql db.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
Is MySql DB server installed in the device where you run the app? Is it in Running state? Are you sure "root" is the correct Password? Did you try SslMode=None?
Beta Was this translation helpful? Give feedback.
All reactions
-
MySql Db installed on my pc, (open server panel), and im using Android emulator of VisualStudio 2022(Pixel 5),
should i install db to the android emulator??.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.