Unable to connect: Can't connect to MySQL server (111)

Hi everybody,
I`m having a problem when configuring a mysql connection in my production environment.(nm_ini_manager2.php)

If I try to connect a local database everything is ok.
If I try to connect with a remote server I receive the error: Unable to connect: Can’t connect to MySQL server (111).

However, in dev. environment I was able to define the remote connection succesfully.
I’m able to connect the remote server with Heidi.

Does anyone any idea about what the problem is or
how to configure a remote connection in production environment of SC?

Anyone have experience working with remote database servers in SC?

Many thanks in advance

Jos? Miguel

Is this in windows or with linux?
Assuming it is with windows: you need to run your webserver then with a user that has networking rights. This is not the default under windows server/win 7/… . Similarly goes for linux as well.
So very likely this is a rights issue, so create a user that has network rights but has some normal limitations and choose the webserver service to run under that users.
Either that or write some rights elevation code… It kind of depends on what webserver you use.

However, in dev. environment I was able to define the remote connection succesfully.
I’m able to connect the remote server with Heidi.

Does anyone any idea about what the problem is or
how to configure a remote connection in production environment of SC?

Anyone have experience working with remote database servers in SC?

remote mysql isnt different to sql that is on the same machine. All you need to do is have access to that remote mysql. Since you havent answered wither you use windows or linux I’ll explain why I asked.
If you have windows running your scriptcase apache server then this server runs under rights that are limited. The user it runs under does not have the rights to allow all kinds of access outside the www path of the webserver. Hence a connection from that scriptcase service is also not allowed to an outside machine, since that user under which the scriptcase apache runs doesnt have the rights to go outside the machine itself.
Therefore the solution is to set the webserverice so that another user is running it, a user with the rights to reach that mysql server you are talking about. Hence you need to make such a user and give that user the proper access rights. After that simply stop the apache service, change the user that runs it to the newly created user and restart the apache webservice and you are done.
For security be sure to not give that new user too many rights, but I guess you’ll be aware of that.

Under linux I dont know the details well enough to be able to fully help you…

The connection is refused by MySQL because the user you specified does not have the rights to connect from the IP-adddress
where your deployed application is located.

Go to the MySQL server and check/change the privileges for this particular user and IP-address.

If both MySQL server and your application are on the same server you have to use either localhost or 127.0.0.1
Again check on the privileges in MySQL which one to use.

jsb