Ошибка при подключении к бд unable to connect to any of the specified mysql hosts

I am getting the above error when I execute the code —

MySqlConnection mysqlConn=new MySqlConnection("server=127.0.0.1;uid=pankaj;port=3306;pwd=master;database=patholabs;");
        mysqlConn.Open();

I have tried setting server to localhost, user to root but I get the following error-

Error: 0 : Unable to connect to any of the specified MySQL hosts.
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>DBSync.exe</AppDomain><Exception><ExceptionType>MySql.Data.MySqlClient.MySqlException, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d</ExceptionType><Message>Unable to connect to any of the specified MySQL hosts.</Message><StackTrace>
at  MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at DBSync.MainForm.BtnCalculateClick(Object sender, EventArgs e) in c:Documents  and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncMainForm.cs:line 51
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at DBSync.Program.Main(String[] args) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncProgram.cs:line 27</StackTrace><ExceptionString>MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at DBSync.MainForm.BtnCalculateClick(Object sender, EventArgs e) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncMainForm.cs:line 51
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at DBSync.Program.Main(String[] args) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncProgram.cs:line 27</ExceptionString><DataItems><Data><Key>Server Error Code</Key><Value>1042</Value></Data></DataItems></Exception></TraceRecord>

I can connect to the mysql server through mysql workbench and query the database. It is only the code that doesn’t work.
Edit: I have noticed that the error crops up when I am using sharpdevelop and not when I am using Visual Studio.

Привет!
вот пытаюсь подключиться к базе данных, но выдает такую ошибку —
60f4031fdaf9d159669943.png
и еще эту же ошибку выводит в такой строке
*****
adapter.Fill(table);
*****

private void connecting_Click(object sender, EventArgs e)
        {
            string userLogin = userName.Text;
            string pass= Pass.Text;
            int hash = Convert.ToInt32(Hash.Text);

            baseUsers db = new baseUsers();
            DataTable table = new DataTable();
            MySqlDataAdapter adapter = new MySqlDataAdapter();
            MySqlCommand command = new MySqlCommand("SELECT * FROM `users` WHERE 'name' = @uL AND 'pass' = @uK AND 'hash' = @uH", db.GetConnection());

            command.Parameters.Add("uL", MySqlDbType.VarChar).Value = userLogin;
            command.Parameters.Add("uK", MySqlDbType.VarChar).Value = pass;
            command.Parameters.Add("uH", MySqlDbType.Int32).Value = hash;

            adapter.SelectCommand = command;
            adapter.Fill(table);

            if (table.Rows.Count > 0)
            {
                MessageBox.Show("user [true]", "INFO");
            }
            else
            {
                MessageBox.Show("user [false]", "INFO");
            }

        }

прошу помощи , подключаюсь на удаленный сервер, вот данные (возможно указаны не правильно)

static string user = «server=77.222.40.101;port=5431;username=users;password=USER00;database=userBase»;

EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

1

30.11.2016, 12:24. Показов 24157. Ответов 10

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Пишу лаунчер к программе, завис на форме авторизации, ввожу логин, пароль — выходит ошибка «MySql.Data.MySqlClient.MySqlException || Unable to connect to any of the specified MySQL hosts». Купил домен на nic.ru — там же зашел в phpmyadmin — вот собсно и ошибка. Раньше создавал на локальной БД соединение в phpmyadmin-все работало, эту же таблицу импортировал и в новую бд на nic.ru — ошибка… Почитав форумы, особо ответа не нашел, единственное: проверил telnet на порты — работает только 80, я так понимаю phpmyadmin по жэфолту коннектится на 3306? Может стоит прописать порт — но у меня чот не вышло..вообщем код:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace SportPage
{
    public partial class RegPage : Form
    {
        private MySqlConnection connection;
        private RegisPage Reg = new RegisPage();
        public RegPage()
        {
            InitializeComponent();
        }
        #region
        private void db_connect()
        {
            try
            {
                MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();
                builder.Server = "дэфолтстраница.mysql";
                builder.UserID = "тотжедэфолт_cms02";
                builder.Password = "pass";
                builder.Database = "db_cms02"; например
                builder.Port = Convert.ToUInt16("80");
               
//это я раньше в локальной бд работал...
/*
                builder.Server = "127.0.0.1";
                builder.UserID = "root";
                builder.Password = "IMBMan1997";
                builder.Database = "SportPage";
               */
               
                connection = new MySqlConnection(builder.ToString());
                connection.Open(); //inserting NEW USER data into User table 
            }
            catch (MySqlException e)
            {
 
                throw;
            }
        }
        private bool login(string Username, string Password)
        {
 
            db_connect();
            MySqlCommand check = new MySqlCommand();
            check.CommandText = "select * from Users Where Username =@User and Password=@Pass";
            check.Parameters.AddWithValue("@User", Username);
            check.Parameters.AddWithValue("@Pass", Password);
            check.Connection = connection;
            MySqlDataReader login = check.ExecuteReader();
            if (login.Read())
            {
                connection.Close();
                return true;
            }
            else
            {
                connection.Close();
                return false;
            }
        }
#endregion
 
      
        private void CloseButton_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
 
        private void Voity_Click(object sender, EventArgs e)
        {
            string Username = NameBox.Text;
            string Password = PassBox.Text;
            if (Username == "" || Password == "")
            {
                MessageBox.Show("Одно или несколько полей оказались незаполненными!");
                return;
            }
            bool r = login(Username, Password);
            if (r)
            {
                MessageBox.Show("УРА");
                MainForm main = new MainForm();
                this.Close();
                main.Show();
            }
            else
                MessageBox.Show("Ошибка входа!");
        }
 
        private void RegButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            Reg.Show();
        }
    }
}



0



Администратор

Эксперт .NET

15672 / 12631 / 5005

Регистрация: 17.03.2014

Сообщений: 25,715

Записей в блоге: 1

30.11.2016, 23:52

2

EvilSky, чтобы подключиться к удаленному MySQL серверу нужно знать его IP адрес или DNS имя. На удаленном хосте должны быть разрешены внешние подключения — можно узнать у тех.поддержки. Порт лучше оставить стандартный, но возможно на хостинге может использоваться другой порт — это тоже можно узнать у тех.поддержки.



0



EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

01.12.2016, 11:06

 [ТС]

3

Ну, когда я настраивал хостинг, то установил использование DNS-серверов услуг RU-CENTER как «Хостинг», и он, вроде как, исходит из 3 дэфолтных dns-серверов :
ns3.nic.ru; ns4.nic.ru; ns8.nic.ru. Проверил настройки доступа пользователей к БД — все включено. Ну и про порт я читал, что доступен только 80, но тогда узнаю в поддержке поточней еще…А если необходимо знать dns и ip — где его указать? Нужно менять строку подключения? Единственное я поменял в блоке «Try» строчку

C#
1
 builder.Port = 80;

, но все равно ошибка..

Миниатюры

Unable to connect to any of the specified MySQL hosts
 



0



Администратор

Эксперт .NET

15672 / 12631 / 5005

Регистрация: 17.03.2014

Сообщений: 25,715

Записей в блоге: 1

01.12.2016, 11:16

4

EvilSky, настройки DNS и права доступа для данном вопроса роли не играют.

Цитата
Сообщение от EvilSky
Посмотреть сообщение

А если необходимо знать dns и ip — где его указать?

В параметре server строки соединения.



0



3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

01.12.2016, 11:59

 [ТС]

5

Я там до создания темы смотрел коннекты, но не нашел, как и сейчас подходящей строки



0



Администратор

Эксперт .NET

15672 / 12631 / 5005

Регистрация: 17.03.2014

Сообщений: 25,715

Записей в блоге: 1

01.12.2016, 12:16

6

EvilSky, они в самом начале находятся

MySQL Connector/Net

Standard
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Specifying TCP port
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername; Pwd=myPassword;
The port 3306 is the default MySql port.



0



EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

01.12.2016, 12:27

 [ТС]

7

C#
1
2
3
4
5
 builder.Server = "bdForExample.mysql";
                builder.UserID = "userForExample_mysql";
                builder.Password = "Pass";
                builder.Database = "example_db";
                builder.Port = 80;

ну изначально был такой коннект, только теперь надо заменить строчку

C#
1
builder.Server = "bdForExample.mysql";

на

C#
1
builder.Server = "бла.бла.бла.бла";

или на dns?



0



Администратор

Эксперт .NET

15672 / 12631 / 5005

Регистрация: 17.03.2014

Сообщений: 25,715

Записей в блоге: 1

01.12.2016, 12:41

8

Лучший ответ Сообщение было отмечено EvilSky как решение

Решение

EvilSky, давай для начала разберемся с терминами. У сервера в интернете есть два адреса (упрощенно) — ip адрес и DNS-имя (доменное имя). Например, yandex.ru <-> 77.88.55.60. Преобразование DNS-имени в IP-адрес выполняет DNS-сервер который был указан администратором домена.

В рамках твоей задачи в параметре Server нужно указать адрес сервера — то есть IP адрес или DNS-имя.

Цитата
Сообщение от EvilSky
Посмотреть сообщение

«bdForExample.mysql»

Указание такого имени означает что в сети существует данный домен и значит мы можем набрать команду ping bdForExample.mysql и увидеть ответ подтверждающий что домен существует. Попробуй это сделать и посмотри что тебе скажет ping.



1



3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

01.12.2016, 12:47

 [ТС]

9

Это вы хорошо объяснили, спасибо! Я коннектился по принципу работы с OpenServer, по такому же принципу коннектился, сейчас дошло. Теперь он, вроде как коннектится, но с ошибкой — «Дополнительные сведения: Не удается прочитать данные из транспортного соединения: Попытка установить соединение была безуспешной, т.к. от другого компьютера за требуемое время не получен нужный отклик, или было разорвано уже установленное соединение из-за неверного отклика уже подключенного компьютера.»



0



Администратор

Эксперт .NET

15672 / 12631 / 5005

Регистрация: 17.03.2014

Сообщений: 25,715

Записей в блоге: 1

01.12.2016, 12:49

10

EvilSky, ошибка говорит что подключение не удалось. Скорее всего данный порт закрыт на стороне хостера. Повторяю свой совет — свяжись с тех. поддержкой хостинга.



1



3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 194

01.12.2016, 12:51

 [ТС]

11

Да,я тоже об этом подумал. Все-таки задам им вопрос о доступе порта. Спасибо



0



  An error occurred using the connection to database 'joyoi_mgmtsvc' on server '127.0.0.1'.

MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.Serialization.MySqlSession.d__52.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.ConnectionPool.d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.d__61.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.d__14.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.d__34.MoveNext()

Перейти к контенту

I am trying to create a login form connected to a MySQL database. I installed the sql connector inserted in the form but when I try to connect I get error unable to connect to any of the specified MySQL hosts. Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace ECBSRecruitmentAgencySoftware
{
    public partial class LogIn : Form
    {
             public LogIn()
        {
            InitializeComponent();
        }

             public bool tryLogin(string username, string password)
             {
                 MySqlConnection con = new MySqlConnection("host=think-tek.net;user=ctutorial;password=chang3d;database=ctutorial_logintest;");
                 MySqlCommand cmd = new MySqlCommand("Select * FROM login WHERE user_name = `" + username + "` AND user_pass = `" + password + "`;");
                 cmd.Connection = con;
                 con.Open();
                 MySqlDataReader reader = cmd.ExecuteReader();
                 if (reader.Read() != false)
                 {
                     if (reader.IsDBNull(0) == true)
                     {
                         cmd.Connection.Close();
                         reader.Dispose();
                         cmd.Dispose();
                         return false;
                     }
                     else
                     {
                         cmd.Connection.Close();
                         reader.Dispose();
                         cmd.Dispose();
                         return true;
                     }
                 }
                 else 
                 {
                     return false;
                 }
             }
        private void button1_Click(object sender, EventArgs e)
        {

            if (tryLogin(textBox1.Text, textBox2.Text) == true)
            {
                MainScreen F2 = new MainScreen();
                F2.Show();
                this.Hide();
            }

             else MessageBox.Show("Wrong details!");

        }




}
}

aleroot's user avatar

aleroot

70.1k30 gold badges173 silver badges210 bronze badges

asked May 16, 2012 at 12:39

Nikolay Dyankov's user avatar

Nikolay DyankovNikolay Dyankov

1271 gold badge3 silver badges11 bronze badges

6

This site is pretty helpful in terms of connection strings. Your connection string seems to be invalid.

Also: Make sure your user has the proper access privileges. Many hosting providers only enable access from localhost. You may have to request that they enable your user for remote access.

answered May 16, 2012 at 13:07

Splatbang's user avatar

1

My connection string for MySQL is:

string mySqlConn = "server=localhost;user=username;database=databasename;port=3306;password=password;";

What exception is thrown for your connection string? There should be a error number.

answered May 16, 2012 at 12:48

Robert H's user avatar

Robert HRobert H

11.4k18 gold badges67 silver badges107 bronze badges

2

Try the connection string in given format in the sample:

public bool tryLogin(string username, string password)
             {
                 MySqlConnection con = new MySqlConnection("SERVER=localhost;" +
                    "DATABASE=mydatabase;" +
                    "UID=testuser;" +
                    "PASSWORD=testpassword;");
                 MySqlCommand cmd = new MySqlCommand("Select * FROM login WHERE user_name = `" + username + "` AND user_pass = `" + password + "`;");
                 cmd.Connection = con;
                 con.Open();
                 MySqlDataReader reader = cmd.ExecuteReader();
                 if (reader.Read() != false)
                 {
                     if (reader.IsDBNull(0) == true)
                     {
                         cmd.Connection.Close();
                         reader.Dispose();
                         cmd.Dispose();
                         return false;
                     }
                     else
                     {
                         cmd.Connection.Close();
                         reader.Dispose();
                         cmd.Dispose();
                         return true;
                     }
                 }
                 else 
                 {
                     return false;
                 }
             }          

answered May 16, 2012 at 12:46

Romil Kumar Jain's user avatar

Romil Kumar JainRomil Kumar Jain

19.9k9 gold badges62 silver badges92 bronze badges

3

I had the same problem and error was in connection string! Somehow, I declare it twice to two different locations. Once to my localhost and second time to server machine database. When I published the project on client machine it was impossible to connect to localhost(what was my computer).:-) and I was wondering how do I get this: «unable to connect to any of specified mysql hosts»

this is how man can make his life complicated for days! :-)

of course, i was able to connect to db on server machine.

So, just for example, this was my problem. And, solution was to declare to it once and to one database!!!

And also, I would like to share my connection string that worked just fine:

cs = @»server=xxx.xxx.xxx.xxx;uid=xxxx;password=xxxxxxxxx;database=xxxxx;port=3306″;

ЯegDwight's user avatar

ЯegDwight

24.6k10 gold badges45 silver badges52 bronze badges

answered Sep 1, 2012 at 10:41

Sylca's user avatar

SylcaSylca

2,5234 gold badges29 silver badges51 bronze badges

your string connection is right there is no error,but fist check it on local server
this is exception only raise your xampp is not running, first start xampp
go to browser and type localhost,if its working you will see xampp menu
if it open localhost then try to connect whatever your server is

string connection = "server=localhost;database=student_record_database;user=root;password=;";
            MySqlConnection con = new MySqlConnection(connection);

answered Feb 7, 2015 at 11:14

Adiii's user avatar

AdiiiAdiii

50.9k6 gold badges132 silver badges135 bronze badges

public bool tryLogin(string username, string password)
{
    MySqlConnection con = new MySqlConnection("SERVER=xx.xx.xx.xx;DATABASE=dbname;UID=user;PASSWORD=password;CheckParameters=False;");
    MySqlCommand cmd = new MySqlCommand("Select * FROM login WHERE user_name = `" + username + "` AND user_pass = `" + password + "`;");
    cmd.Connection = con;
    con.Open();
    MySqlDataReader reader = cmd.ExecuteReader();
    if (reader.Read() != false)
    {
        if (reader.IsDBNull(0) == true)
        {
            cmd.Connection.Close();
            reader.Dispose();
            cmd.Dispose();
            return false;
        }
        else
        {
            cmd.Connection.Close();
            reader.Dispose();
            cmd.Dispose();
            return true;
        }
    }
    else 
    {
        return false;
    }
}

Bill Tür stands with Ukraine's user avatar

answered Aug 21, 2017 at 10:51

Ritesh Roushan's user avatar

0

I am getting the above error when I execute the code —

MySqlConnection mysqlConn=new MySqlConnection("server=127.0.0.1;uid=pankaj;port=3306;pwd=master;database=patholabs;");
        mysqlConn.Open();

I have tried setting server to localhost, user to root but I get the following error-

Error: 0 : Unable to connect to any of the specified MySQL hosts.
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>DBSync.exe</AppDomain><Exception><ExceptionType>MySql.Data.MySqlClient.MySqlException, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d</ExceptionType><Message>Unable to connect to any of the specified MySQL hosts.</Message><StackTrace>
at  MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at DBSync.MainForm.BtnCalculateClick(Object sender, EventArgs e) in c:Documents  and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncMainForm.cs:line 51
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at DBSync.Program.Main(String[] args) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncProgram.cs:line 27</StackTrace><ExceptionString>MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at DBSync.MainForm.BtnCalculateClick(Object sender, EventArgs e) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncMainForm.cs:line 51
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at DBSync.Program.Main(String[] args) in c:Documents and SettingsTest01My DocumentsSharpDevelop ProjectsDBSyncDBSyncProgram.cs:line 27</ExceptionString><DataItems><Data><Key>Server Error Code</Key><Value>1042</Value></Data></DataItems></Exception></TraceRecord>

I can connect to the mysql server through mysql workbench and query the database. It is only the code that doesn’t work.
Edit: I have noticed that the error crops up when I am using sharpdevelop and not when I am using Visual Studio.

EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

1

30.11.2016, 12:24. Показов 22965. Ответов 10

Метки нет (Все метки)


Пишу лаунчер к программе, завис на форме авторизации, ввожу логин, пароль — выходит ошибка «MySql.Data.MySqlClient.MySqlException || Unable to connect to any of the specified MySQL hosts». Купил домен на nic.ru — там же зашел в phpmyadmin — вот собсно и ошибка. Раньше создавал на локальной БД соединение в phpmyadmin-все работало, эту же таблицу импортировал и в новую бд на nic.ru — ошибка… Почитав форумы, особо ответа не нашел, единственное: проверил telnet на порты — работает только 80, я так понимаю phpmyadmin по жэфолту коннектится на 3306? Может стоит прописать порт — но у меня чот не вышло..вообщем код:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace SportPage
{
    public partial class RegPage : Form
    {
        private MySqlConnection connection;
        private RegisPage Reg = new RegisPage();
        public RegPage()
        {
            InitializeComponent();
        }
        #region
        private void db_connect()
        {
            try
            {
                MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();
                builder.Server = "дэфолтстраница.mysql";
                builder.UserID = "тотжедэфолт_cms02";
                builder.Password = "pass";
                builder.Database = "db_cms02"; например
                builder.Port = Convert.ToUInt16("80");
               
//это я раньше в локальной бд работал...
/*
                builder.Server = "127.0.0.1";
                builder.UserID = "root";
                builder.Password = "IMBMan1997";
                builder.Database = "SportPage";
               */
               
                connection = new MySqlConnection(builder.ToString());
                connection.Open(); //inserting NEW USER data into User table 
            }
            catch (MySqlException e)
            {
 
                throw;
            }
        }
        private bool login(string Username, string Password)
        {
 
            db_connect();
            MySqlCommand check = new MySqlCommand();
            check.CommandText = "select * from Users Where Username =@User and Password=@Pass";
            check.Parameters.AddWithValue("@User", Username);
            check.Parameters.AddWithValue("@Pass", Password);
            check.Connection = connection;
            MySqlDataReader login = check.ExecuteReader();
            if (login.Read())
            {
                connection.Close();
                return true;
            }
            else
            {
                connection.Close();
                return false;
            }
        }
#endregion
 
      
        private void CloseButton_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
 
        private void Voity_Click(object sender, EventArgs e)
        {
            string Username = NameBox.Text;
            string Password = PassBox.Text;
            if (Username == "" || Password == "")
            {
                MessageBox.Show("Одно или несколько полей оказались незаполненными!");
                return;
            }
            bool r = login(Username, Password);
            if (r)
            {
                MessageBox.Show("УРА");
                MainForm main = new MainForm();
                this.Close();
                main.Show();
            }
            else
                MessageBox.Show("Ошибка входа!");
        }
 
        private void RegButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            Reg.Show();
        }
    }
}

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

Администратор

Эксперт .NET

15226 / 12265 / 4902

Регистрация: 17.03.2014

Сообщений: 24,867

Записей в блоге: 1

30.11.2016, 23:52

2

EvilSky, чтобы подключиться к удаленному MySQL серверу нужно знать его IP адрес или DNS имя. На удаленном хосте должны быть разрешены внешние подключения — можно узнать у тех.поддержки. Порт лучше оставить стандартный, но возможно на хостинге может использоваться другой порт — это тоже можно узнать у тех.поддержки.

0

EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

01.12.2016, 11:06

 [ТС]

3

Ну, когда я настраивал хостинг, то установил использование DNS-серверов услуг RU-CENTER как «Хостинг», и он, вроде как, исходит из 3 дэфолтных dns-серверов :
ns3.nic.ru; ns4.nic.ru; ns8.nic.ru. Проверил настройки доступа пользователей к БД — все включено. Ну и про порт я читал, что доступен только 80, но тогда узнаю в поддержке поточней еще…А если необходимо знать dns и ip — где его указать? Нужно менять строку подключения? Единственное я поменял в блоке «Try» строчку

C#
1
 builder.Port = 80;

, но все равно ошибка..

Миниатюры

Unable to connect to any of the specified MySQL hosts
 

0

Администратор

Эксперт .NET

15226 / 12265 / 4902

Регистрация: 17.03.2014

Сообщений: 24,867

Записей в блоге: 1

01.12.2016, 11:16

4

EvilSky, настройки DNS и права доступа для данном вопроса роли не играют.

Цитата
Сообщение от EvilSky
Посмотреть сообщение

А если необходимо знать dns и ip — где его указать?

В параметре server строки соединения.

0

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

01.12.2016, 11:59

 [ТС]

5

Я там до создания темы смотрел коннекты, но не нашел, как и сейчас подходящей строки

0

Администратор

Эксперт .NET

15226 / 12265 / 4902

Регистрация: 17.03.2014

Сообщений: 24,867

Записей в блоге: 1

01.12.2016, 12:16

6

EvilSky, они в самом начале находятся

MySQL Connector/Net

Standard
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Specifying TCP port
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername; Pwd=myPassword;
The port 3306 is the default MySql port.

0

EvilSky

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

01.12.2016, 12:27

 [ТС]

7

C#
1
2
3
4
5
 builder.Server = "bdForExample.mysql";
                builder.UserID = "userForExample_mysql";
                builder.Password = "Pass";
                builder.Database = "example_db";
                builder.Port = 80;

ну изначально был такой коннект, только теперь надо заменить строчку

C#
1
builder.Server = "bdForExample.mysql";

на

C#
1
builder.Server = "бла.бла.бла.бла";

или на dns?

0

Администратор

Эксперт .NET

15226 / 12265 / 4902

Регистрация: 17.03.2014

Сообщений: 24,867

Записей в блоге: 1

01.12.2016, 12:41

8

Лучший ответ Сообщение было отмечено EvilSky как решение

Решение

EvilSky, давай для начала разберемся с терминами. У сервера в интернете есть два адреса (упрощенно) — ip адрес и DNS-имя (доменное имя). Например, yandex.ru <-> 77.88.55.60. Преобразование DNS-имени в IP-адрес выполняет DNS-сервер который был указан администратором домена.

В рамках твоей задачи в параметре Server нужно указать адрес сервера — то есть IP адрес или DNS-имя.

Цитата
Сообщение от EvilSky
Посмотреть сообщение

«bdForExample.mysql»

Указание такого имени означает что в сети существует данный домен и значит мы можем набрать команду ping bdForExample.mysql и увидеть ответ подтверждающий что домен существует. Попробуй это сделать и посмотри что тебе скажет ping.

1

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

01.12.2016, 12:47

 [ТС]

9

Это вы хорошо объяснили, спасибо! Я коннектился по принципу работы с OpenServer, по такому же принципу коннектился, сейчас дошло. Теперь он, вроде как коннектится, но с ошибкой — «Дополнительные сведения: Не удается прочитать данные из транспортного соединения: Попытка установить соединение была безуспешной, т.к. от другого компьютера за требуемое время не получен нужный отклик, или было разорвано уже установленное соединение из-за неверного отклика уже подключенного компьютера.»

0

Администратор

Эксперт .NET

15226 / 12265 / 4902

Регистрация: 17.03.2014

Сообщений: 24,867

Записей в блоге: 1

01.12.2016, 12:49

10

EvilSky, ошибка говорит что подключение не удалось. Скорее всего данный порт закрыт на стороне хостера. Повторяю свой совет — свяжись с тех. поддержкой хостинга.

1

3 / 3 / 2

Регистрация: 17.11.2014

Сообщений: 193

01.12.2016, 12:51

 [ТС]

11

Да,я тоже об этом подумал. Все-таки задам им вопрос о доступе порта. Спасибо

0

  An error occurred using the connection to database 'joyoi_mgmtsvc' on server '127.0.0.1'.

MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.Serialization.MySqlSession.d__52.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.ConnectionPool.d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.d__61.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.d__14.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.d__34.MoveNext()

  • Remove From My Forums
  • Question

  • User535994284 posted

    Hi
    I created website in ASP.NET 2.0 and MYSQL.
    MYSQL data base is at remore server. I can connected to MySQL successfully but when I upload my site to Share hosting, it throws following error.
    I think ,On my local m/c I have installed MYSQL management tool so I can connect successfully but on shared hosting, it may not so this error is coming,

    Any clue how can we enable our remote shared host to connect to MYSQL

    [MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
       MySql.Data.MySqlClient.NativeDriver.Open() +1142
       MySql.Data.MySqlClient.Driver.Open() +69
       MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +89
       MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +11
       MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +257
       MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +117
       MySql.Data.MySqlClient.MySqlPool.GetConnection() +113
       MySql.Data.MySqlClient.MySqlConnection.Open() +309
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState&amp; originalState) +31
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
       ASP.test_aspx.getuser() in d:hosting5454799htmlTestingtest.aspx:25
       ASP.test_aspx.Page_Load(Object sender, EventArgs e) in d:hosting5454799htmlTestingtest.aspx:12
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesA

Answers

  • User-1315512054 posted

    Hello,

    Check if your ASP.NET MySQL hosting provider do not block remote MySQL connections. Most shared hosting companies
    do not allow remote connections.

    Regards

    • Marked as answer by

      Thursday, October 7, 2021 12:00 AM

ISSUE #1 : Connection Errors

Once mysql has racked up enough connection errors, the host blocks all IPs until you do one of two things:

  • $ service mysql restart
  • mysql> FLUSH HOSTS;

According to MySQL Documentation on FLUSH HOSTS;

HOSTS

empties the host cache tables. You should flush the host tables
if some of your hosts change IP address or if you get the error
message Host ‘host_name’ is blocked. When more than max_connect_errors
errors occur successively for a given host while connecting to the
MySQL server, MySQL assumes that something is wrong and blocks the
host from further connection requests. Flushing the host tables
enables further connection attempts from the host. See Section
C.5.2.6, “Host ‘host_name’ is blocked”. You can start mysqld with
—max_connect_errors=999999999 to avoid this error message.

Try bumping up max_connect_errors (default is 10) to some obnoxiously high number, like 999999999 (about 1 billion), in /etc/my.cnf as follows:

[mysqld]
max-connect-errors=999999999

You will then just restar mysql. To put this new setting in place without restarting, just run this command in the mysql client:

mysql> SET GLOBAL max_connect_errors = 999999999;

ISSUE #2 : DNS

If you are connecting to mysql using DNS, this could be one possible source of issues if:

  • DNS servers go down
  • DNS servers cannot be reached

To alleviate DNS issues, you need to add the following to /etc/my.cnf (mysql restart required):

[mysqld]
skip-host-cache
skip-name-resolve

You also need to look at the host column of mysql.user. If any of the users have a DNS name, replace it with one of the following choices:

  • Public IP
  • Private IP
  • LoadBalacner-managed VIP
  • Netblocks (such as 10.1.2.%) of the first three choices

Afterwards, run mysql> FLUSH PRIVILEGES;

MySQL error 1042: Unable to connect to any of the specified MySQL hosts.

tags: Javaweb error

 your configuration for MySQL Server 8.0.21 has failed,you can find more information about the fail

Click log on the right, you will findMySQL error 1042: Unable to connect to any of the specified MySQL hosts.

Open the service in computer management

Click MySQL80, right-click Properties—>Login—>Log in with local account

 

 

Intelligent Recommendation

Unable to connect to any hosts due to exception

Link mysql, I found that the database is directly related with the name of the exception, 1 name in the database can not contain special characters such as an underscore. 2 database name can not be to…

Install mysql 1042 error

Log: Beginning configuration step: Writing configuration file Ended configuration step: Writing configuration file Beginning configuration step: Updating Windows Firewall rules Attempting to delete a …

mysql installation error 1042

Install mysql exception occurred in a fast close to completion: error 1042:Unable to connect to any of the specified MySQL hosts Mysql not directly lead to the abnormality Finish normal, as shown: ope…

More Recommendation

MySQL 1130 error, unable to connect remotely

1 Error: ERROR 1130: Host ‘192.168.1.3’ is not allowed to connect to this MySQL serve Error 1130: Host 192.168.1.3″ does not allow connection to thismysql service Cause: The connected data is not…

Unable to connect to the MySQL server error 10061

System: Windows Error as follows: MySQL Workbench can not connect to the database. Navicat displays error 10061 This error is because the database is not connected, the Explorer can not see the proces…

MySQL database unable to connect

This paragraph error message appears, mainly due to database time zone errors Connect the database run Permanent solution, appended behind the connection pathserverTimezone=UTC jdbc:mysql://localhost/…

MySQL unable to connect Navicat

Solve MySQL Connection error: 1251-Client Does Not Support Authentication Protocol Requester by Server; Consider Upgrading MySQL CLIENT Use the Navicat to connect to MySQL8.0 Times: 1251-Client does n…

  • Remove From My Forums
  • Question

  • Hi all, 

    I have run into an issue and not able to resolve it. 

    There was a requirement to connecting to a MySQL data source. For that I unknowingly added an entry in the «ODBC Data Source Administrator» ->
    User DSN & System DSN 

    I was totally unaware that I am breaking my SP setup (Development). Now Central Admin site and all other sites have stopped working. 

    I tried repairing by re-running the config wizard but no use. Error I get is «An unexpected error has occurred.» OR «Unable to connect to any of the specified MySQL hosts.» 

    But when I try accessing other site, its showing an error from the «machine.config» file: >

    Line 284:    <siteMap>
    Line 285:      <providers>
    Line 286:        <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
    Line 287:      </providers>
    Line 288:    </siteMap>

    Source File: C:WindowsMicrosoft.NETFramework64v4.0.30319Configmachine.config 

    For record, I have already removed those entries from that User DSN & System DSN.
    Still error persists. 

    If some has ANY IDEA how to resolve it… please help! 


    Regards, Nayan

Answers

  • Hi Nayan,

    I faced the same problem as you encounter. I have Googling for 1 hours. This is the MySQL Connector bugs.  For some solution is to comment out the config in
    machine.config file.

    the path of machine.config file as below

    C:WindowsMicrosoft.NETFramework64v4.0.30319Configmachine.config 

    <!--        <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, 
    
    MySql.Web.v20, Version=6.9.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" 
    
    connectionStringName="LocalMySqlServer" applicationName="/" /> -->

    But this solution not work for me.

    So the next solution is to change the installation file by go to control panel -> program -> select Mysql connector and select change. uncheck the web provider and next all the way. Then the issues resolve. Hope it help.

    Regards,

    RenneHong

    • Marked as answer by

      Wednesday, November 18, 2015 1:06 PM

  • Hi Renne,

    Yes I had ultimately implemented the same workaround to overcome this.

    After commenting many such tags which get added automatically after installing MySQL connector 6.9; our setup starts working again.


    Regards, Nayan

    • Marked as answer by
      Nayan N
      Wednesday, November 18, 2015 1:06 PM

  • Ошибка при подключении к ncalayer mac os
  • Ошибка при подключении к ncalayer egov
  • Ошибка при подключении к itunes 0x8000084
  • Ошибка при подключении к dlna устройству error resource not found
  • Ошибка при подключении к dlna устройству error invalid args