Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

itsbarry

macrumors newbie
Original poster
May 14, 2009
23
0
Hello everyone,

I need your help!!! I'm trying to install MySQL on my iMac to learn SQL. I downloaded it and installed it, but I'm having so much difficulty trying to use the darn thing through the Terminal with "guides" that I've been reading online, but to no avail.

I tried MAMP, but I don't know if I'm doing something incorrect. I don't see where I would type the SQL commands.

Can anyone assist me? I've been wanting to learn this for months and I don't want to give up when I didn't even get started. If you can put it in "n00b-specific" language for me, that would be great.

Thanks again for your time and consideration.

:apple:
 

twoodcc

macrumors P6
Feb 3, 2005
15,307
26
Right side of wrong
well, you can type in sql commands in terminal.

first you have to type: mysql -u username -p

put your username in for 'username'

and it will then ask for your password. and then you can type in your sql commands.

but before you can do this, you have to set your root password. i can't remember how to do it off the top of my head. just google for it, and if you can't find it, then i'll help you look
 

itsbarry

macrumors newbie
Original poster
May 14, 2009
23
0
Thanks for your reply.

When I try that input in the terminal, it says: command not found.

Hmmm, I'll play around with it a bit more.
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
Or it's installed but it's somewhere that's not in the system PATH list. See http://dev.mysql.com/doc/refman/5.0/en/setting-environment-variables.html. You'll probably have to modify a text file to have this set when you log in. You can add it in Terminal but it won't stick when you log out otherwise. Make sure if you use a GUI editor for this that it's plain text only or supports editing plain text (such as TextWrangler, BBEdit, TextMate, etc.). Do not use TextEdit or Microsoft Word unless you're sure you're saving in plain text.

Before doing this, as a test, try running this:

Code:
/usr/local/mysql/bin/mysql
 

Winni

macrumors 68040
Oct 15, 2008
3,207
1,196
Germany.
For starters, you can also download and install the MySQL GUI Tools from the MySQL website and use those. The MySQL packages also include a startup item for the MySQL server and even a small GUI interface to start and stop the MySQL server from the System Preferences menu. You don't need to spend your time on the command line.

However, on the long run, you --have to-- learn how to use and configure the UNIX shell. And you should do so before you even think about learning MySQL itself. There are so many things that can only be done on the shell level, so there is just no way around it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.