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 Database Foundations Installing MySQL Server and MySQL Workbench Installing MySQL Server and Workbench on OS X

Sarut Jarumaneeroj
Sarut Jarumaneeroj
14,656 Points

TEST DB CONNECTION PROBLEMS

THEEW ARE 3# THINGS HAPPEN ANYONE PLEASE HELP I HAD SPENT MANY HOURS TO SOLVE THIS bUT IT DOESN"T WORK !

-Could not connect to MySQL server: -Access denied for user 'root'@'localhost' (using -password: YES) -You may continue if the server is simply not running.

5 Answers

Ben Michel
Ben Michel
3,170 Points

MySQL Workbench has changed quite a bit since this video was made. I'll lay out the current steps needed to get this running on OSX, and I hope this provides your solution if just by adjusting your settings or reinstallation of the workbench and/or MySQL server entirely.

1) Click the Apple icon on the top left of your screen, then click "About This Mac" and make a not of what OSX version you have currently installed.

2) Visit the Download MySQL Page and download & install the DMG Archive package that fits your OSX version (Mine is 10.10.2 so the 'Mac OS X 10.9 (x86, 64-bit), DMG Archive' package works for me). Note: You will only get the .pkg file from this download because the optional 'MySQL.prefPane' file is now a default option to install in the installer application. If you just enter in your password and keep clicking continue, it and the other defaults will be installed just fine.

3) Download and install the MySQL Utilities from the MySQL Utilities Page. Make sure you choose the DMG file that fits your OSX version. (Mine is 10.9 since I have 10.10.2)

4) Download & install the MySQL Workbench from the MySQL Workbench Page (make sure that you have the 'Mac OS X' platform option selected), and move the app icon into your applications folder.

5) Copy the example config file:

  1. Type Command ⌘ – Space Bar to get the Spotlight Search open, type "terminal" and hit enter. To open the terminal app.
  2. Type $ sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf at the command prompt (You may get a warning about using the 'sudo' command, but it's ok in this case).
  3. Enter your account's password.

6) Open up the MySQL Workbench app. You're going to get the 'home' screen, which is totally different from what's in the video, but that's ok.

  1. Either type Command ⌘ – U or click 'Database > Connect to Database...' in the navigation bar to make sure you can connect to the new database.
  2. The Hostname (127.0.0.1), Port (3306), and Username (root) should all be the same as in the video by default. Make sure they are and click 'ok.'
  3. Now you should have a new view in the app with at least the a 'Query 1' tab, and the 'MANAGEMENT' pane on the left. Click 'Server Status' and look at the opened 'Administration' tab to check if your server is running. If not click the 'INSTANCE' button, then click the 'Start Server' button. It will ask you for your password, and just enter in your computer account's password. Do the same if it asks you when you stop the server as well.

After this you should have your MySQL server running at localhost, and ready to go!

Hope this helped. :)

Thank you for this, Ben! The Setup and interface looks very different and your guidance was spot-on. Cheers.

Thank you! Your instructions really helped me out.

SURAKSHA RAMESH SHETTY
SURAKSHA RAMESH SHETTY
52 Points

Hello Ben,

I tried everything that you mentioned. But when I create a new connection and configure its management setting and try to test the connection, it asks for a password and whatever password I type it displays the following message: "Failed to connect to MySQL at 127.0.0.1:3306 with user root Access denied for user 'root'@'localhost' (using password: YES)"

Can you please help me out with this???

Amazing Ben! Truly great step by step explanation!

Ryan Hageman
Ryan Hageman
3,635 Points

Ben...

You're the best!