I know this question was asked a lot before but I tried some of the solutions which were given and nothing worked..
I have downloaded MySQL Workbench 6.1 on
In my case I had a previous mySQL server installation (with non-standard port), and I re-installed to a different directory & port. Then I got the same issue. To resolve, you click on home + add new connection.
If you need to know the port of your server, you can find it when you start My SQL command line client via All Programs -> MySQL -> MySQL ServerX.Y -> MySQL X.Y Command Line Client and run command status (as below)
Just in case anyone needs this. For me in my case, I had installed a new installation of MYSQL(8) and WORKBENCH etc. so that I could then work on an old Wordpress website. No matter what I did, it wouldn't work. Kept getting "ERROR ESTABLISHING CONNECTION" etc. Thinking that it was maybe something to do with wordpress(since it is old), i tried a basic manual connection with php and nothing.
Eventually, I figured out that I had to downgrade MYSLQ. So i went back to MYSQL installer, found the server, and downgraded MYSQL from 8.0 back to 5.5
As soon as I did that, everything worked. Hope this helps
Avoid using bind_address
in your my.cnf file, if you have any.
Ref: http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html
maybe it has a different solution, but I fixed it by finding mysqld.exe and running following command in the console:
C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console
You should be able to see following result:
Resolved this issue by navigating to C:\xampp\mysql\bin and double clicking on mysqld.exe and then allow access in the pop up that comes. My server status on workbench changed to running
I solved the problem as follows:
run MySQLInstanceConfig.exe
C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\MySQLInstanceConfig.exe
Follow to the end without changing anything.