# Unable to connect to any of the specified MySQL hosts

**URL:** <https://forums.percona.com/t/unable-to-connect-to-any-of-the-specified-mysql-hosts/18195>\
**Category:** Percona Server for MySQL\
**Tags:** mysql, percona, new-release\
**Created:** [October 26, 2022, 1:05pm UTC](https://forums.percona.com/t/unable-to-connect-to-any-of-the-specified-mysql-hosts/18195 "2022-10-26T13:05:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buyuk\_basri](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@buyuk\_basri](https://forums.percona.com/u/buyuk_basri)\
**Post date:** [October 26, 2022, 1:05pm UTC](https://forums.percona.com/t/unable-to-connect-to-any-of-the-specified-mysql-hosts/18195/1 "2022-10-26T13:05:38Z")

</div>

Hello to everyone,

From time to time I get an error like the following on my MySQL server, why does it give this error, I can’t see any problems in the logs.

\*\*

> Unable to connect to any of the specified MySQL hosts. → One or more errors occurred. → No connection could be made because the target machine actively refused it

\*\*  
@Aleksandra_Abramova Aleksandra\_Abramova @Michael_Coburn Michael\_Coburn  
@matthewb

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [October 26, 2022, 1:41pm UTC](https://forums.percona.com/t/unable-to-connect-to-any-of-the-specified-mysql-hosts/18195/2 "2022-10-26T13:41:55Z")

</div>

Hi @buyuk_basri  
What is [bind\_address](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_bind_address) configured to? you need it listening at least on an IP that can be routed from your application

---

<div class="post-metadata">

**Author:** ![cristydavidd](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cristydavidd](https://forums.percona.com/u/cristydavidd)\
**Post date:** [November 9, 2022, 9:41am UTC](https://forums.percona.com/t/unable-to-connect-to-any-of-the-specified-mysql-hosts/18195/3 "2022-11-09T09:41:47Z")

</div>

In some of the ways, spacing and the order of parameters in the MySql connection string does matters. So, stick to the standard format:

`MysqlConn.ConnectionString = "Server=localhost;Port=1234;Database=My_Mysql_Database;Uid=root;Pwd=root;"`

If the above connection string fails, try update your c# mysql connection string as shown below (without port variable as well):

`MysqlConn.ConnectionString = "Server=localhost;Database=My_Mysql_Database;Uid=root;Pwd=root;"`

Or, sometime the problem could be on your windows firewall, make sure your server allow access to all port associated with your mysql database.
