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 trial

Development Tools

Brandon Selfors
Brandon Selfors
5,019 Points

mySQL Workbench Connection

Hello,

I read many forums about how to fix the connection issue between workbench and MAMP and have not found anything to help. I am running MAMP and both Apache and MySQL and running. When I open workbench and setup a new instance, I follow the instructions as given in the "database" tutorials yet still no connection.

Within the workbench connections, I have changed "connection name" to localhost. Same with Hostname field. I left the port to default 3306. I even changed both ports on workbench and MAMP to have the same port and different port using the MAMP suggestion in the "php" tutorial which is 8889. I left username to root and created a password. Basically I think i tried it all but need to some help solving this issue. Thanks - Brandon

10 Answers

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hi this is how I got it working on my local machine:

1) Make sure that the MySQL instance is running

2) Take note of the connection details

3) Click New Connection

4) Fill in the Connection Details from the MAMP startupscreen (2)

5) Double click on the connection you just made

Enter your MAMP password and you should be connected to write queries.

After you've got that working you can optionally go over and create an instance and select the credentials from the drop down. You should use MAMP to manage if the server is running or not though :)

Hope that helps.

I'm having MySQL Workbench problems too. I found this answer that sounds a lot like what you're encountering.

Brandon Selfors
Brandon Selfors
5,019 Points

Awesome I got it working thanks Andrew Chalkley and Sharon!

Brandon Selfors
Brandon Selfors
5,019 Points

I don't have a my.cnf file and I am using Mac. Any other suggestion?

I'm not great with Macs but I think this file is created by MySQL Workbench the first time you use it. As to why it's not there, sorry, I don't know. :(

Brandon Selfors
Brandon Selfors
5,019 Points

I still have not figured this out...

Maybe Andrew Chalkley will know?

Brandon Selfors
Brandon Selfors
5,019 Points

Thanks! I will try this out and get back to you asap.

I know that I may be a little to late but this link helped me out big time with linking workbench to MAMP

I followed the step by step and after applying the password as "root" which I will change at a later date, I it said I was connected and now I'm ready to get started.

Let me know if this helps

Jimmy Maurice
Jimmy Maurice
9,379 Points

Thanks a lot ! It works. :)