Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEthan Rader
3,121 PointsInstalling mySQL Workbench on OSX: Can't connect to server
So I was easily able to go through the installation video and download mySQL workbench. Even though the video is outdated, I've got the Workbench 6.0 and I figured out how to add a new server instance. However I came across two problems:
First, in the video it shows that you have the ability to set up a local vs remote host, it doesn't do this when I go to add a new server. Is there something I'm missing?
Second, I tried making a new server instance anyways, and it defaults my hostname to 127.0.0.1. When I go to configure the rest of the setup, the initial connection test gives me the following results:
Failed to Open Database Connection Failed to Get Server Version Failed to Get Server OS
Could not connect to MySQL server: Can't connect to MySQL server on '127.0.0.1' (61) You may continue if the server is simply not running.
I've seen online that I should consider re-installing, but the Workbench download is brand new. Should I try it anyways. Anything else I should look at?
5 Answers
John Hietter
4,802 PointsWhen starting out in the workbench, click the + next to MySQL Connections. Set connection name and hostname to "localhost" like he did in the video.
Click the lower left button, "Configure Server Management." Then just keep clicking through to finish setup. Once through that, back at the window where you entered "localhost," click "test connection," as instructed in the video, and finally, "ok."
When I first went through this process, I didn't get the green checkmarks that he did in the video, however, once I set the server to "running," I got all the green checkmarks to show up.
Charles Carrasquero
1,352 PointsHey guys, not sure if someone stated this but this worked for me:
Go to System preferences -> MySql and check the state of your MySql instance.
Worked like a champ after that. Hopefully that'll do!
Ian Hock
7,604 Pointsyou 'expletive' nailed it on the 'expletive' head. thanks charles
Eva Geer
1,081 PointsYes, thank you!! Now it's asking for a password however... sigh.
Zachary Kent
7,133 PointsThanks Charles! Just solved my issue as well :)
Becky Castle
15,294 PointsI followed John Hietter's instructions, and got 2 out of the 3 checkmarks on the "Testing Host Machine Settings" tab (in the "Configure Local Management" window), but I'm still not able to connect to host machine. Any advise?
gbp
5,619 PointsI am stumped as well. I have installed MySQLWorkbench for OS X 7 and MySQL server but cannot connect to database server. I went through what John Hietter suggested above but got no success. Thank you for your help.
Anthony DeFreitas
9,809 PointsI'm assuming that you got mysql server installed ok? What do you get when you type 'which mysql' from the terminal?
You set up a remote host the same way that you setup a local tcp/ip host. The only difference is that you add the address and credentials of the remote host that you have access to.
Did you enter root for the username and 3306 for the port?
Did you add the utility to System Preferences and is the server running? Try 'mysql' from the terminal.
It sounds like your server isn't running.
Maximilian Lemos
1,654 PointsI am having the same issue as the original poster.
When I type 'which mysql' in the terminal I get: /usr/local/mysql/bin/mysql
When I type 'mysql' in the terminal I get:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Any suggestions?