Failed to connect to database. SQLSTATE[HY000] [2002]

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Praveen
Posts: 9
Joined: February 9th, 2017, 4:21 am

Failed to connect to database. SQLSTATE[HY000] [2002]

Post by Praveen »

Hello,

My name praveen, I had been using cspro which it was for windwos but now as it has a sever version, i wanted to used it too.
Though i have installed wamp server in my system where all there services are working fine , where phpmyadmin and the localhost is working yet the issue is that when i am trying to configure csweb it shows me error on the second parge:

Failed to connect to database. SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.



Please suggest me the way what should be done to resolve this issue.

Thanks
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by josh »

Make sure when you are in the setup step of csweb you use "localhost" for the database hostname.
Praveen
Posts: 9
Joined: February 9th, 2017, 4:21 am

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by Praveen »

Thank you so much sir for reply ,

I have uploaded the file, like now i have tried to use the default db.
Attachments
Capture(CSWEB).JPG
Capture(CSWEB).JPG (58.38 KiB) Viewed 5399 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by josh »

Seems like a problem with your MySQL configuration. Can you connect to the database using phpmyadmin or the mysql command line?

If you have setup mysql to run on a different port than the default port you will need add the port to the hostname. For example for port 3307 you would use localhost:3307.
Praveen
Posts: 9
Joined: February 9th, 2017, 4:21 am

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by Praveen »

thank you so much sir,

finally, configured, now I wanted to know like i have logged in and using the deploy application module i have uploaded it too. Now, If i want to download this app to my android phone can I do this.


or, What else do i need to do, if this is not possible. I need a central server kind of thing from which I could upload and download data and application.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by josh »

To download the application to your mobile device after deploying it use "Add application" on your device. See the help for details: http://www.csprousers.org/help/CSDeploy ... obile.html

For synchronizing the data that is collected on the mobile device you have two options:
1) Set up a simple synchronization using the synchronization options dialog
2) Use a menu program to implement advanced synchronizations

More details on both are in the help: http://www.csprousers.org/help/CSPro/sy ... ation.html
Praveen
Posts: 9
Joined: February 9th, 2017, 4:21 am

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by Praveen »

Thank you so much sir,

For you instant reply, I have followed all the steps given in the csweb ppt for configuring the wampserver while in the local host I can access it too.

But now , I want to use it globally and my phone in other province could access it , what do I need to do for that.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Failed to connect to database. SQLSTATE[HY000] [2002]

Post by josh »

For that you need to have a server on the public internet. That is beyond what we can help you with. We limit our assistance to setting up CSWeb. You are responsible for configuring the web server. CSWeb is meant for users who already have or know how to setup and maintain a web server. If you do not know how to do that you should use Dropbox sync or hire someone who can help you with the server setup.
Post Reply