Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Connection error #1324

Answered by tcsaddul
zokirjanov asked this question in Q&A
May 24, 2023 · 1 comments · 2 replies
Discussion options

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. 
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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?

You must be logged in to vote
2 replies
Comment options

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??.

Comment options

Answer selected by zokirjanov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /