Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Can’t login to mySQL in Terminal

Can’t login to mySQL in Terminal
Thread Tools
Forum Regular
Join Date: Jun 2003
Status: Offline
Reply With Quote
Mar 10, 2004, 01:34 AM
 
I have mySQL installed and running on 10.2.6. I enter in the Terminal

mysql> -h 127.0.0.1 –u root –p password

And it doesn’t let me login, all I get is -> on a new line. I enter it again and it doesn’t work.

I have CocoaMySQL, installed too, and my ip, login and password all work, but I want to be able to use MySQL in the Terminal for learning the SQL commands.

Does anyone know to fix this?
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Mar 10, 2004, 02:45 AM
 
err, if you're entering that at the mysql prompt, as your post seemed to indicate, then you're already in. you only enter that line from a normal shell prompt. should look something like this:

mysql -h localhost -u root -p <return>
<enter password>
mysql>_

that last line would've looked boss with the blink tag on that cursor.
(Last edited by philzilla; Aug 20, 2004 at 04:11 PM. )
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Mar 12, 2004, 04:11 PM
 
In addition to what phil said; you have to end all sql commands with a semicolon ( once you are in mysql using the Terminal.

To recap do the following:

[you prompt] user% mysql -h localhost -u root -p <return>
Enter Password: <type password and press return>

You should now be in MySQL monitor; the prompt should be:

mysql>

Once you're there type select a database start learning:

SQL Commands (note the semicolon):

Select Database = use <database name>;
List all DB = show database;
etc.

Hope this helps.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:01 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2