gpt4 book ai didi

Cannot connect to MySQL Workbench on mac. Can't connect to MySQL server on '127.0.0.1' (61) Mac Macintosh(无法连接到Mac上的MySQL工作台。无法连接到‘127.0.0.1’(61)Mac Macintosh上的MySQL服务器)

转载 作者:bug小助手 更新时间:2023-10-27 20:31:11 31 4
gpt4 key购买 nike



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.

无法连接到Mac上的MySQL工作台。我收到以下错误:无法连接,服务器可能未运行。无法连接到‘127.0.0.1’上的MySQL服务器(61)如有帮助,将不胜感激。



Thank You!

谢谢!


更多回答
优秀答案推荐

Go to System preferences -> MySql and check the state of your MySql instance.

进入系统偏好设置->MySQL并检查您的MySQL实例的状态。



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:

遇到了类似的问题,我的问题是MySQL安装时将自身配置为在非默认端口上运行。我不知道原因,但要找出MySQL在哪个端口上运行,请在MySQL客户端运行以下命令:



SHOW GLOBAL VARIABLES LIKE 'PORT';


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

如果您无法使用MySQL-WORKBASE连接到Mac OS X MySQL服务器,可能有一个或多个原因。



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.

最常见的问题与MySQL-SERVER的安装有关。很少有人会忘记在安装MySQL-WORKBASE之前安装服务器。其他一些人会安装产品的一部分。请检查您是否也安装了包含MySQL-SERVER包的MySQL-SERVER dmg(磁盘镜像)文件附带的所有3个部分。这三个部分是:MySQL服务器、首选项面板和启动项。



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

注意:如果您没有选择首选项面板,那么您将无法从系统首选项启动MySQL服务器实例。



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.

在确保安装了每个项目之后,您就可以检查本地MySQL服务器的服务器实例了。从坞站打开系统首选项,然后单击MySQL。然后单击启动MySQL服务器以启动服务器实例。如果服务器实例停止,那么MySQL-WORKBORKE将无法连接到MySQL服务器。



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:

如果您仍然面临问题,则需要检查您正在进行的连接的端口。默认端口是‘3307’,而不是‘3306’。您可以在MySQL终端使用以下命令进行查看:



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.

请注意,此过程将帮助您连接到本机实例。如果您必须连接到远程服务器,则必须输入特定的IP和端口。如果您遇到此问题,请与您的服务器管理员联系。因为这个问题特别说明了问题与连接到本地实例有关,所以我不是在写您可能需要确保的检查。




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."

“第一个命令将您带到您的主目录,并打开.bash_profile文件或创建一个新的文件(如果该文件不存在),然后在上面的行中添加MySQL二进制路径,将MySQL二进制路径添加到您可以运行的命令中。通过键入”control+x“退出文件,并在出现提示时通过键入”y“保存更改。这里要做的最后一件事是重新加载外壳程序,以便上面的操作立即生效。”




source ~/.bash_profile
mysql -v




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

“您将再次获得版本号,只需键入”q“即可退出。”




  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)!

在MySQL客户端(外壳)中每次使用分号!



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!

现在您知道了您的端口以及在哪里可以配置服务器(在带有MySQL外壳/客户端的终端中)。但要成功连接到MySQL Benchmark或其他客户端,您必须了解更多信息。用户名、密码主机名和端口。安装后,根用户没有密码,因此在带有MySQL外壳/客户端的终端中设置(HowtoSetPW)密码。并且服务器正在本地运行。因此,输入根用户、您的PW、本地主机和3007。玩得开心!



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

尝试重新启动MySQL或启动它(如果尚未启动)。在终端中键入此命令。



mysql.server restart

Mysql.server重新启动



To auto start go to the following link below:

要自动启动,请转至以下链接:



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

如何在OS X Yosemite/El Capitan上启动时自动加载MySQL



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.

在我的例子中,我安装了以前的MySQL服务器(使用非标准端口),然后重新安装到不同的目录和端口。然后我遇到了同样的问题(在Windows中)。要解决此问题,请单击主页+添加新连接。



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

如果您需要知道服务器的端口,可以在启动My SQL命令行客户端并运行命令状态时找到它(如下所示)。在Windows中,它是通过所有程序-> MySQL -> MySQL Server X.Y -> MySQL X.Y命令行客户端



how to create



how to find port



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.

在此之后,您可以转到MySQL工作台并测试连接。它应该是可以连接的。



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

BREW服务使用/usr/local/Cellar/mysql/5.6.27/homebrew.mxcl.mysql.plist,启动MySQLdefualt set--BIND-ADDRESS=127.0.0.1,因此将--BIND-ADDRESS=127.0.0.1替换为--BIND-ADDRESS=*或--BIND-ADDRESS=0.0.0.0



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

对于Mac:在工作台>首选项>MySQL中检查MySQL服务器的兼容版本



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

如果它与您的MySQL服务器的版本相同,请访问:cd/usr/local/



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

在收到相同的错误后,我正在MacOS上使用这些命令



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


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

我也有同样的问题。我完全删除了MySQL,并使用自制软件重新安装。



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/

如果您尚未安装MySql,请从以下链接下载: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.

我希望我能帮上忙。你们好啊。



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 :-)

我打开“系统偏好设置”,点击“MySQL”,然后点击“初始化数据库”按钮。我输入了一个新密码,并将其保存在一个安全的地方。之后,我重新启动了MySQL实例(也在系统首选项对话框中)。之后,我打开MySqlWorkbench,打开默认连接,输入我之前设置的密码:Viola,我可以做我想做的任何事情:-)



I had this same issue on Monterey. Make sure you're selecting the correct download according to your processor architecture.

我在蒙特利也遇到过同样的问题。确保根据您的处理器体系结构选择正确的下载。


Community download processor architecture

社区下载处理器架构


Also, for the Connection Method use the Local Socket/Pipe
connection method

此外,对于连接方法,请使用本地插座/管道连接方法



Dropping this to share my experience.

放下这篇文章来分享我的经历。


I had the same problem and realise I didn't start MySql server.

我遇到了同样的问题,并意识到我没有启动MySQL服务器。


The steps below shows how I was able to login:

以下步骤显示了我是如何登录的:



  1. To start your server, Go to Preference and find MySql.

  2. Click on the instance tab to start the server

  3. Afterward, return back to Mysql Workbench to start the Local Instance and you'll be connected.


Have fun !

祝你玩得开心!



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.

我在Mac OS Catalina上也遇到过类似的问题,最简单的解决方法就是下载Mac版的自制软件包管理器。按照步骤安装HOMEBREW和MySQL服务器。



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

$/usr/bin/ruby-e“$(cURL-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”



$ brew install mysql

$BREW安装MySQL



$ brew tap homebrew/services


$BREW TAP自制/服务




$ brew services start mysql

$BREW服务启动MySQL



mysqladmin -u root password 'yourpassword'

Mysqladmin-u超级用户密码‘you password’



Now try using mySQLworkbench it should work.

现在尝试使用mySQL工作台,它应该可以工作。


更多回答

I don't see MySql in System preferences

我在系统首选项中看不到MySQL

Are you sure that MySql is installed?

您确定已安装MySQL吗?

I have MySQL Workbench installed.

我已经安装了MySQL工作台。

MySQL Workbench does not include MySQL Server. You must install it too.

MySQL工作台不包括MySQL Server。您也必须安装它。

perfect! This has helped me as well. I wasted 2-3 hours connecting mysql. It was running on 3307 and not 3306.

完美!这对我也有帮助。我浪费了2-3个小时连接MySQL。它是在3307上运行的,而不是3306。

That's awesome! Thanks! My server was indeed running on 3307 for some reason.

太棒了!谢谢!出于某种原因,我的服务器确实在3307上运行。

Same here. It was listening on 3307 (not 3306). What the heck - anyone know why? I thought maybe I got myself in trouble where I did a brew install mysql then also realized I wanted the preference pane so I went and ran the community server dmg install.

我也是.第3307章(不是3306)怎么回事-有人知道为什么吗?我想也许我给自己惹了麻烦,我做了一个brew安装mysql,然后也意识到我想要的首选项窗格,所以我去运行社区服务器dmg安装。

same here, successfully connected 3307.

我也是,已成功接通3307。

but what do you mean in MySql Client? not clear, where I should run this command?

但在MySQL客户端中是什么意思呢?不清楚,我应该在哪里运行这个命令?

> Default port is '3307' and NOT '3306'. OH MY GOD THAT COST ME SO MANY HOURS. I can't thank you enough!

>默认端口为‘3307’,不是‘3306’。天哪,那花了我这么多时间。我无法表达对您的感谢!

That wrong port however was a mistake. The official default port is still 3306.

然而,那个错误的港口是一个错误。官方默认端口仍为3306。

I am using those commands: sudo /usr/local/mysql/support-files/mysql.server start </br> sudo /usr/local/mysql/support-files/mysql.server stop <\br> sudo /usr/local/mysql/support-files/mysql.server restart

我正在使用以下命令:sudo/usr/local/mysql/Support-Files/mysql.server start
sudo/usr/local/mysql/Support-files/mysql.servertop<\br>sudo/usr/local/mysql/Support-Files/mysql.serart

This worked for me. I tried all the other ways. This is the only one that worked! Thanks!

这对我很管用。我试过了所有其他的方法。这是唯一有效的方法!谢谢!

Mysql wouldn't work from my workbench, I just added the socket path instead of localhost, and it worked fine. But mysql> status did the trick!

MySQL不能在我的工作台上运行,我只添加了套接字路径,而不是本地主机,它运行得很好。但是MySQL>Status做到了!

It would be better if you could explain your answer in a more coherent way.

如果你能以一种更连贯的方式解释你的答案,那就更好了。

nothing need to explain, all the tomfoolery with my.cnf does not work on MAC OSX when you use HOMEBREW to install mysql. homebrew use default value '--bind-address=127.0.0.1' may consider of the safe.

没有什么需要解释的,当你使用自制软件安装MySQL时,my.cnf的所有愚蠢之举在Mac OSX上都不起作用。自制软件使用默认值‘--BIND-ADDRESS=127.0.0.1’可以考虑安全性。

in the path /usr/local/Cellar/mysql/5.7.18_1/support-files/mysql.server take the statement of "# If you install MySQL on some other places than /usr/local/Cellar/mysql/5.7.18_1, then you # have to do one of the following things for this script to work: #...Create a /etc/my.cnf file with the following informati "

在路径/usr/local/Cellar/mysql/5.7.18_1/support-files/mysql.server采取的声明“#如果你安装MySQL的一些其他地方比/usr/local/Cellar/mysql/5.7.18_1,那么你#必须做以下事情之一,这个脚本的工作:#.使用以下信息创建/etc/my.cnf文件

second link not working

第二个链路不起作用

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com