I am new to go and trying to get the http server to do what I want it to do. I have frequently triggered a possible server socket conflict that I can only resolve locally by a reboot. Online requires installing a backup
###Details:
// web-page error:
A PHP Error was encountered
Severity: Warning
Message: mysqli_connect(): (HY000/2002): Connection refused
As mentioned locally it has happened frequently and I would like to know if it is possible to prevent this MySql error or at least a Kludge to prevent a reboot or another backup installation
If the Go code you showed us in your first post is your entire Go application, then it has nothing to do with the MySQL error.
You might be able to figure out what happened to MySQL by looking at the log files, but it’s not related to Go from what we can see here.
My bet is that Apache is running port 80, and you forgot to visit your Go website on :8080 (the :8080 tells the server which port you want to connect to)
The things are quite simple. You use in your program a port (let say 8080) to listen requests sent to your program. Also, other programs hosted on that machine listen other ports. Maybe other program listen the same port like you and result a conflict. With netstat (the top part of the result) you ca see who and what listen and this can help you to change ports properly.
tip: also try netstat -l | grep :
note that is netstat -l (from listen) not netstat - 1
Yep, the solution is not killing the process but stopping the service who already listen 8080 or configure Apache or whatever to listen other port than 8080. Otherwise simply move your go service to other port.