[mysql] Cannot connect to MySQL Workbench on mac. Can't connect to MySQL server on '127.0.0.1' (61) Mac Macintosh

Cannot connect to MySQL Workbench on mac. I get the following error: Could not connect, server may not be running. Can't connect to MySQL server on '127.0.0.1' (61) The help would be appreciated.

Thank You!

This question is related to mysql mysql-workbench

The answer is


I had the same issue, I solved this with the following steps:

  1. Install the MySql (DMG) from this link

  2. If the mysql package comes with the file name "mysql-5.7.13...." and "MySql.prefPane" then your life is really easy. Just click on "mysql-5.7.13...." and follow the instructions.

  3. After the installation is done, click on "MySql.prefPane" and checkout "Only for this user" in the popup. We use "MySql.prefPane" to start the mysql server as this is really imp because without this you will end up having errors.

  4. Click on Start MySql Server in the next dialog box.

    OR

    If you don't see "MySql.prefPane" in the package then follow these steps:

    1. Click on package "mysql-5.7.13...." and this will show you one password as soon as installation is done. That password is use to start the connection. You can change it. I will let you know in a while.

    2. After installation save the password (this is really important - you'll need it later), open terminal. $ cd /usr/local/mysql/bin/ $ ./mysql -u root -h localhost -p And then type the password from above. This should start mysql>

    3. To change the password: $ cd /usr/local/mysql/bin/ $ ./mysqladmin -u root -p password 'new_password' Enter Password: <type new password here> $ ./mysql -u root -h localhost -p ... and log in with the new password.

After this you can go to MySql workbench and test connection. It should connect.


I had the same problem. I removed mySQL completely, and reinstall it using homebrew.


I had similar issues in Mac OS Catalina and the easiest way to solve it is by downloading HOMEBREW package manager for mac. Follow the steps to install HOMEBREW and mysql server.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

$ brew install mysql

$ brew tap homebrew/services?

$ brew services start mysql

mysqladmin -u root password 'yourpassword'

Now try using mySQLworkbench it should work.


Try restarting the mysql or starting it if it wasn't started already. Type this within terminal.

mysql.server restart

To auto start go to the following link below:

How to auto-load MySQL on startup on OS X Yosemite / El Capitan


I ran into the same scenario

I opened "System Preferences", clicked "MySQL", then clicked "Initialize Database" button. I entered a new password and saved it in a safe place. After that i restarted the MySql Instance (in the System Preferences dialog as well). After that i opened MySqlWorkbench and opened the default connection, entered the password i set before and: Viola, i can do whatever i want :-)


for mac : check the compatible version of mysql server in workbench>preference>MySql

if it's the same version with your mysql server in: cd /usr/local/


This steps are all in the terminal:)->source

  1. Step make sure your server is running:

sudo /usr/local/mysql/support-files/mysql.server start

  1. Check MySQL version. "This also puts you in to a shell interactive dialogue with mySQL, type q to exit."

/usr/local/mysql/bin/mysql -v

  1. Make your life easier: "After installation, in order to use mysql commands without typing the full path to the commands you need to add the mysql directory to your shell path, (optional step) this is done in your “.bash_profile” file in your home directory, if you don’t have that file just create it using vi or nano:"

cd ; nano .bash_profile

paste in and save:

export PATH="/usr/local/mysql/bin:$PATH"

"The first command brings you to your home directory and opens the .bash_profile file or creates a new one if it doesn’t exist, then add in the line above which adds the mysql binary path to commands that you can run. Exit the file with type “control + x” and when prompted save the change by typing “y”. Last thing to do here is to reload the shell for the above to work straight away."

source ~/.bash_profile mysql -v

"You will get the version number again, just type “q” to exit."

  1. Check out on which port the server is running:

in your terminal type in: mysql

and then

SHOW GLOBAL VARIABLES LIKE 'PORT';

use everytime a semikolon in the mysql client (shell)!

now you know your port and where you can configure your server(in the terminal with mysql shell/client). but for a successful connection with MySQL Benchmark or an other client you have to know more. username, passwort hostname and port. after the installation the root user has no passwort so set(howtoSetPW) the passwort in terminal with mysql shell/client. and the server is running local. so type in root, yourPW, localhost and 3007. have fun!


There may be one or multiple reasons if you are not able to connect to MAC OS X MySQL server with MySQL-workbench.

When you press 'test connection' you might see this error. This could be explained briefly if you go step by step through 'Configure server management..' On the basis of the red crosses you can filter out the real problem.

The most common problems are associated with the installation of MySQL-server. Few people either forget to install the server prior to installing MySQL-workbench. Some others would install a part of the product. Please check whether you have also installed all the 3 parts that comes with the MySQL-Server dmg(disk image) file which contains mysql-server package. Those 3 parts are: MySQL server, preference pane and startup item.

Note: If you haven't selected preference pane then you won't be able to start mysql server instance from the System preferences.

After you make sure that you have installed each item then you can check server instance of your native mysql-server. Open System preferences from dock and click MySQL. Then click Start MySQL Server to start the server instance. If the server instance is stopped, then MySQL-workbench won't be able to connect to the MySQL server.

If you are still facing issue, then you need to check the port of the connection which you are making. Default port is '3307' and NOT '3306'. You can check it with using the following command in mysql terminal:

SHOW GLOBAL VARIABLES LIKE 'PORT';

Please note that this process helps you to connect to the local instance. If you have to connect to a remote server, then you have to enter that specific IP and Port. Contact your server's administrator if you are facing the issue. As this question specifically states that the problem is related to connecting to the local instance, I am not writing checks that you may need to ensure.


I had same problem, but it worked for me.

  1. check if you have mysql installed

    enter image description here

If you don't have mysql installed, download from this link: https://dev.mysql.com/downloads/mysql/

  1. follow this instructions to install https://dev.mysql.com/doc/mysql-osx-excerpt/5.7/en/osx-installation-pkg.html

  2. You can test the connection without any problem.

(Sorry for my english, I agree fix me please)

I Hope I've helped. Greetings.


Ran into a similar issue and my problem was that MySQL installed itself configured to run on non-default port. I do not know the reason for that, but to find out which port MySQL is running on, run the following in MySql client:

SHOW GLOBAL VARIABLES LIKE 'PORT';

I am using those commands on MacOs after getting the same error

sudo /usr/local/mysql/support-files/mysql.server start

sudo /usr/local/mysql/support-files/mysql.server stop

sudo /usr/local/mysql/support-files/mysql.server restart

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 (in windows). 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 and run command status (as below). In windows it is via All Programs -> MySQL -> MySQL ServerX.Y -> MySQL X.Y Command Line Client

how to create

how to find port


brew services start mysql defualt set --bind-address=127.0.0.1 with /usr/local/Cellar/mysql/5.6.27/homebrew.mxcl.mysql.plist,so replace --bind-address=127.0.0.1 with --bind-address=* or --bind-address=0.0.0.0