[英]Cant connect to mysql server when port is change c#
Im using xammp as my platform for my database我使用 xammp 作为我的数据库平台
Usually the defualt port of mysql is 3306 and it is working properly通常mysql的默认端口是3306并且它工作正常
But when I change the port like 4444 in my.ini I have an error message receive但是当我在 my.ini 中更改像 4444 这样的端口时,我收到一条错误消息
cannot connect to any of the specified mysql hosts无法连接到任何指定的 mysql 主机
By using this connection string通过使用此连接字符串
string connectString = "datasource=xxx.xx.xx.xxx;port=4444;username=root;password="";database=XXXXX;";
Well XAMPP might require a restart of MySQL server in order to update open port.那么 XAMPP 可能需要重新启动 MySQL 服务器才能更新开放端口。 But according to Connector strings , parameter "Port" might be ignored if Unix socket is used.但是根据连接器字符串,如果使用 Unix 套接字,参数“端口”可能会被忽略。 So you can also check that.所以你也可以检查一下。
Also, I know that have PHP in title , but I think it might be connected with your problem.另外,我知道title 中有 PHP ,但我认为它可能与您的问题有关。 Try this and say if it helped试试这个并说它是否有帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.