Bug in Multiple Connections

I have a project that uses two connections. It is working on the localhost (Developer PC) but when I deployed it on Webserver second connection seems to be not working and software throws an error

An error occurred while connecting to the database:
Connection attempt failed: SQLSTATE[HY000] [1045] Access denied for user ‘USERNAME’@‘localhost’ (using password: YES)

anybody has this problem before?

http://www.scriptcase.net/forum/forum/scriptcase-8/discussion-aa/71427-multiple-connection-problem

I have had this error occur a couple of times for one project where I have two connections (one of them is not really used, but I cannot get rid of it). I first checked that the user I had defined for the connections in the setup of the production environment was defined correctly and had the proper right. When that was ascertained, I entered the productions environment, redefined the user for the connections and saved. This solved the problem.

Hi Orion,

Thanks for the message.

Could you please elaborate the solution. I am afraid I couldn’t get it correctly.

For your information all working scenarios when I test.
[LIST=1]

  • It works when I test on my localhost on the depeloping machine.
    • Connection1 localhost DB (dev-machine) & Connection2 localhost DB (dev-machine)
  • It also works on my localhost in depeloting machin
    • Connection1 localhost DB (dev-machine) & Connection2 external DB.
    [/LIST]

    multiconnection.png

    connectusinglocalhost.png

  • Hi Naresh,

    First check that the user is correctly created in the database that the web server connects to. From your description it is not clear it is the same database that you use in your development environment. If it is the same database, you must remember that users are assigned privileges with a location as well, e.g. user@localhost, in MySQL, so if web server are accessing the database from another machine, privileges need to be assigned for that the user in the database for that IP address (of the web server), e.g. user@192.168.0.15.

    Lets assume that you have verified that your user and the privileges are all okay for the database and the error message persists. The next step is to reestablish the production environment on the web server. See this description in the ScriptCase help:

    http://www.scriptcase.net/docs/en_us…on-environment

    Basically, what you do is specifying the database, username and password for each of the connections that you have used in the development environment. When you deploy your project this always have to be specified, as the production environment will not know about what your connections pointed to in your development environment.

    Normally, you would only have to set-up the connections in the production environment once, but I have had occasions where I had to set it up again after which the error mentioned would disappear and everything work as per normal again.

    Hi Frank.

    Thank you very much for your post. I hope you are doing well.

    I think we are talking on the same page. I am having these problem in the server where I have deployed the system. I would like to informed you that It works on my Development environment.

    The images I have attached on my previous post are of the Production Environment of server where I have deployed the system.

    I have 2 Database used in system’s application. Main database connection works fine but the application that use the second database it doesn’t allow.

    One more thing, DB user have equal privillages on both Databse.

    However I have reported as the bug to Scriptcase, I have allowed them to get into my deployed server and look into my production environment settings and Scriptcase Bug tracker Team have asked me tosend the project export I have sent it. Let’s see if they come up with any solution to this issue.

    I appreciate and I think I get your point but I am using multiple connections in the same system.

    Cheers mate

    Naresh

    Hi Naresh,

    Okay, perhaps it is a bug and ScriptCase can resolve it for you.

    You could try to resolve it by using remote link connections in mysql as far as I know. This way it all is asif it runs under one database.