Mysql – Unable to create connection on MySQL Workbench Edition in Mac
MySQLmysql-workbench
I have installed MySQL Workbench on my Mac. I am trying to connect the MySQL. I am not able to connect.
I have attached the screenshot.
I am getting Access denied for user 'root'
Best Answer
Common issues:
Is MySQL server running? check that by making sure you have 1 or more processes called mysqld
Is MySQL listening on the 127.0.0.1 address? Make sure it is not running with skip-netwoking or with bind-address different from 0.0.0.0, *, or 127.0.0.1 (it could be only listening on a public ip)
Is there an user called root? It should be there if you just installed it
Did you write the right password- in the latest MySQL versions, mysql gets installed with a random default password. You need to know that or connect to the socket (localhost + socket, not 127.0.0.1 + 3306) using the unix_autentication plugin
What error do you get? It is not the same to get a "could not connect" than a "connection denied"- the first one could be points 1 and 2, the second 3 and 4. Can you connect using the command line "mysql"?
Do you have the latest mysql workbench version? Latest authentication methids may not be supported on old workbench versions
I stumbled upon this question when I myself had encountered this error. I could finally figure out the configuration.
I didn't touch anything in /etc/mysql/my.cnf which already has bind_address = 127.0.0.1. So only localhost can connect.
I use OpenSSH server. So in its config file /etc/ssh/sshd_config I changed from no to yes the param responsible for TCP forwarding, thus AllowTcpForwarding yes.
Finally I have the following entered in MySQL WorkBench.
SSH Hostname: 192.168.0.8:22 (my SSH server listens to port 22)
SSH Username: sshuser
SSH Key File: *C:\Users\windowsuser\.ssh\id_rsa* (should be private key, even though it says public)
MySQL Hostname: 127.0.0.1 (this should not be changed, since MySQL server by default is bound to localhost only which I didn't change)
MySQL Server Port: 3306 (also default)
Username: root
The only remaining thing for you is to configure correctly your SSH server to work with keys rather than passwords. Hope this will help someone.
I hope your problem might have been already resolved.
However, I recently had a similar experience and I had to do following to resolve it.
1. Launch MySQL Workbench (Mine was 5.2.36 CE Revision 8542)
2. Double click on a server instance to manage the server instance
3. Goto Users and Privileges
4. Select root or other user you wish to check from the list in "Server Access Management" tab
5. Change the "Limit connectivity to hosts matching:" to IP that you are using to connect OR just change it to "%" to remove the IP restriction.<6>
6. In my case I had to change it to "%" to make it work.
Hope this will be helpful to someone, someday!
Cheers
Manish.
Best Answer
Common issues:
This is a very common question, please read the manual first for troubleshooting: https://dev.mysql.com/doc/refman/5.7/en/can-not-connect-to-server.html