简体   繁体   中英

Failed to connect to MySQL at 127.0.0.1 in MySQL Workbench. System error 61

I'm running into a little trouble with MySQL Workbench. This is the situation, I'm developing a database to query it remotely from Android devices. This is the first time I use MySQL Workbench, so I've followed this tutorial:

http://net.tutsplus.com/tutorials/databases/visual-database-creation-with-mysql-workbench/

I have no problem creating the EER diagram and generating the SQL script. The problem comes when I try to connect to a MySQL server. I get this error:

" Failed to Connect to MySQL at 127.0.0.1:3306 with user root. Lost connection to MySQL server at 'reading initial communication packet', system error: 61 "

http://img101.imageshack.us/i/capturadepantalla201104i.png/ (if the link stops working tell me)

I've also tried using the Local Socket/Pipe connection method with the MAMP Socket in '/Applications/MAMP/tmp/mysql/mysql.sock', but it gives the same error. And I've also tried using MAMP port 8889 but still nothing.

So anyone knows how to fix it? And another question, can I connect from my Android device to my laptop(where the database is placed) without using MAMP? MySQL needs MAMP to serve queries? And the last thing, am I going into the right way? Or should I do it other way?

Thanks for reading.

I had the same issue, but part of your question is what fixed it for me:

  1. Set connection = Local Socket/Pipe

  2. Set socket path = "/Applications/MAMP/tmp/mysql/mysql.sock" (for me - I got the path from my MySQL log upon initialisation)

Running: MBP, OSX 10.8.3 (Mountain Lion), MAMP Pro

Can't really fathom any further what your issue may be, but perhaps double check your DB is properly initialised. But, perhaps this helps someone else:)

I typed: sudo /usr/local/mysql/support-files/mysql.server start into the terminal and it started the MySQL server successfully and I was able to connect to MYSQL workbench.

Most commonly happens when database/server is not running. You need to check your server, or restart it. You can do so if you have mysql workbench under server administration. Check your manual for restarting or starting the server.

On osx 10.6 using mamp pro I solved this by allowing network access in the MySQL tab from the home window. Hope it saves someone the pain too

You need to sure that Mysql process is running in your system. not sure in MAC but in windows it'called mysqld.exe

well take a look

http://lists.mysql.com/mysql/124371

Try closing MySQL and running it as the admin. This worked for me.

After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench. After which you just need to validate your machine with server (validated HOST). For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.

I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.

Thanks!!!

I solved it. On a mac just go to spotlight search on the top right of the screen and type Mysql. Turn it on.

When trying to use the MySQL Workbench and connect through an SSH tunnel, you will get this error when your SSH connection does not complete successfully (eg improper host, password, key file, etc)

A good way to trouble shoot this is to separately test the the ssh connection from the machine you are trying to connect from and establish that you can do so successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM