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 trialAndrew Chalkley
Treehouse Guest TeacherDatabase Foundations: Stage 2 - Installing MySQL Server and MySQL Workbench Launched
Installing MySQL Server and MySQL Workbench has just launched. We cover installing the MySQL Server and Workbench on Windows and OS X. We also show you how to seed the database with a script file and how to use the MySQL Workbench.
Get it while it's hot!
17 Answers
James Barnett
39,199 PointsThat's some impressive turn around under 20 hours.
I'm so excited you are covering MySQL Workbench, not enough tutorials on MySQL cover that awesome tool.
Nick B
3,593 PointsI've been looking for something just like this! I'm in software quality assurance and work with databases frequently. Unfortunately, I haven't had much training with databases so I occasionally struggle when working with them. These modules will definitely help me understand the basics and become more proficient in my job. Thanks!
Will Ruff
2,836 PointsAndrew,
On this section - http://teamtreehouse.com/library/programming/database-foundations/installing-mysql-server-and-mysql-workbench/installing-mysql-server-and-workbench-on-os-x
Having some trouble with setting up the config file.
When I type in this: "sudo cp /usr/local/mysql/support-files/m"
This is what I see:
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_director
I'm wondering if I made an error during the installation.
Andrew Chalkley
Treehouse Guest TeacherThe command is sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
sudo cp
is the command /usr/local/mysql/support-files/my-default.cnf
is the source_file and /etc/my.cnf
` is the target_file.
You're only typing part of the source_file after the command.
You can copy and paste the command in to your terminal.
Will Ruff
2,836 PointsThanks!
Chris Sohl
406 PointsYou make an excellent teacher, Andrew! I'm new to Treehouse, having started out in database foundations, and I'm not sure what to expect regarding scheduled roll-out of the full course. Is there an ETA for stage 3, and/or what is a typical timeline for stage releases at Treehouse?
Andrew Chalkley
Treehouse Guest TeacherThanks Chris and welcome to Treehouse!
Stage 3 is in post-production (video editing) at the moment. Then it'll go over to QA.
In general we aim to get new stages out every 2 weeks or ~2 a month.
We update our Roadmap here with approximations.
Guru Khalsa
1,735 PointsHey Andrew, your videos have already been a huge help to me so far, you make it all very easy to understand. The one problem I'm having is that when I try to create a server instance it tells me that there is no connection to the MySQL server. I followed all the installation instructions precisely but I can't seem to get it to connect. I also ran the sudo command and double checked in Terminal to make sure that the "my.cnf" file was copied properly into the etc directory. My startup message log shows me this:
2013-05-28 22:50:54 - Checked server status: Server is stopped. 2013-05-28 22:50:58 - Starting server... 2013-05-28 22:50:58 - Start server: usage: sudo [-n] -h | -K | -k | -L | -V | -v usage: sudo -l[l] [-AnS] [-g groupname|#gid] [-U username] [-u username|#uid] [-g groupname|#gid] [command] usage: sudo [-AbEHnPS] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AnS] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] file ...
2013-05-28 22:50:59 - Checked server status: Server is stopped. 2013-05-28 22:50:59 - Server start done.
Thanks so much for all of your help so far (in the videos) and for any help you can provide me with this issue.
Andrew Chalkley
Treehouse Guest TeacherHi Guru,
I'm guessing you're on Mac OS X.
Are you getting this is the WorkBench client? Have you tried rebooting your system?
If you type cat /etc/my.cnf
in your terminal do you get a stream of output in your terminal like:
...
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Justin Fallhowe
2,542 PointsHi Andrew,
Thanks for the Database tutorials - treehouse is a great resource! I am having an issues in the Installing MySQL Server and Workbench on OS X. When I go to the MySQL workbench to start there server I get the following:
2013-07-20 10:55:46 - Starting server...
2013-07-20 10:55:46 - Start server: usage: sudo [-n] -h | -K | -k | -L | -V | -v
usage: sudo -l[l] [-AnS] [-g groupname|#gid] [-U username] [-u username|#uid]
[-g groupname|#gid] [command]
usage: sudo [-AbEHnPS] [-C fd] [-g groupname|#gid] [-p prompt] [-u
username|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AnS] [-C fd] [-g groupname|#gid] [-p prompt] [-u
username|#uid] file ...
2013-07-20 10:55:46 - Checked server status: Server is stopped.
2013-07-20 10:55:46 - Server start done.
2013-07-20 10:55:46 - Checked server status: Server is stopped.
I followed the suggestion you (Andrew) made above (rebooting system) and entered cat /etc/my.cnf into the terminal and received the following message:
...
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
I'm not entirely sure where to go from here...any direction would be super helpful! Thanks
Andrew Chalkley
Treehouse Guest TeacherSo after you press start it starts and stops automatically?
Justin Fallhowe
2,542 PointsAndrew,
Yes - exactly.
Andrew Chalkley
Treehouse Guest TeacherOdd. I've seen when I've mistyped my password when trying to stop it says stopping and then says it's started.
Have you saved the default password the workbench app will try and use?
Guru Khalsa
1,735 PointsHey Andrew,
Thank you very much for the quick response. Yep I'm on OS X, sorry for not specifying before. I figured it out and embarrassingly for myself the problem was simply that the server wasn't running. I am very new to MySQL Workbench and didn't quite understand how the server instances work. I thought that maybe they were supposed to run the server as part of the process. In the video there isn't a specific step that tells you to run the server before creating a server instance, but maybe that's supposed to happen automatically when you install MySQL Community Server and my computer just didn't do it for some reason. Anyway I ran the server from Terminal and that fixed the problem, and then I remembered the MySQL server utility that you helped me install into the System Preferences. I tried running and stopping the server from there and it worked as well. Thank you so much for all of your help and I look forward to finishing the series and finally understanding databases. Thanks again!
Robert Ho
Courses Plus Student 11,383 PointsHey Andrew,
I think Guru has a point. Where in the Introduction to Installation of MySQL videos does it tell you to initialize or execute mySQL and how do you go about doing it? Thanks!
-Robert
Andrew Chalkley
Treehouse Guest TeacherHi Guru Khalsa and Robert Ho,
I'll see if I can corner a video pro tomorrow to see if there was an error in editing.
I'll report my findings :)
Regards Andrew
Andrew Chalkley
Treehouse Guest TeacherI double checked the footage and it wasn't edited, it seems that the optional step of installing the preference pane started it.
But I think if it's not running, when creating an "Instance" to manage it will prompt you to start it. You need to create an "Instance" that's running before you run your queries with the Query Browser.
Robert Ho
Courses Plus Student 11,383 PointsAndrew, at what point does the mySQL "start?" Like at what point during the video, installation of the software, etc etc.
Andrew Chalkley
Treehouse Guest TeacherI looks like it did automatically (?) for me but if you see it stopped @ 4:06 you should start it then. If not you should be prompted around the 7 minute mark through setting up and instance and checking for connection.
May Saleh
1,007 Pointshello Andrew, im loving your video,, i installed both the server and workbench but the later is not showing any thing other than the shortcuts and that one model and and to add connection , what should i do ?
Andrew Chalkley
Treehouse Guest TeacherCan to take a screenshot of it? And email help@teamtreehouse.com
Craig Salmond
Courses Plus Student 7,438 PointsI'm running Mavericks on OS X and when I type the sudo command (copied from above) to copy the config file, it says "No such file or directory." Could it be a problem with Mavericks?
Andrew Chalkley
Treehouse Guest TeacherThere may have been an update to the installer and for some reason they may not have included the my-default.cnf
any more.
Can you open up your terminal and type this:
cd /usr/local/mysql/support-files/
This will navigate you in to a directory that should contain example config files. Type the ls
command in the terminal.
You may see a my-small.cnf
, a my-medium.cnf
and a my-large.cnf
.
If you do you may just need to experiment with the different sizes for your machine.
sudo cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
If the above doesn't work when trying to start the mysql server try
sudo cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
or
sudo cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
Let me know how you get on!
Craig Salmond
Courses Plus Student 7,438 PointsSorry, it was a stupid mistake. I already had MAMP installed and I intended to use it for MySQL, so naturally there wouldn't be a config file in a location that didn't exist. I did get it working though. Thanks, and sorry for the hassle!