Google Answers Logo
View Question
 
Q: MySQL Password Issue ( No Answer,   3 Comments )
Question  
Subject: MySQL Password Issue
Category: Computers > Programming
Asked by: boombot-ga
List Price: $15.00
Posted: 08 May 2006 07:00 PDT
Expires: 14 May 2006 09:58 PDT
Question ID: 726512
I've just installed MySQL on my home machine to work along with the
manual _Agile Web Development with Rails_. I'm absolutely new to MySQL
and have encountered the following error after the command
mysql -u root -p:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

During installation I never set a password. I've input 'admin', 'root'
and other guesses in as the password - the error is always the same.
If I provide a carriage return without entering anything, the error
changes slightly:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 

I've posted this question elsewhere, and have found/recieved some
interesting feedback - but I have absolutely no background in MySQL or
the command line. I'm looking for absolutely thorough and remedial
steps for remedying this problem on a Mac running 10.4.6.

Clarification of Question by boombot-ga on 08 May 2006 19:09 PDT
I'm running MySQL 4.1.18-standard.
Answer  
There is no answer at this time.

Comments  
Subject: Re: MySQL Password Issue
From: frankcorrao-ga on 08 May 2006 12:06 PDT
 
If you didnt set a password then you should be able to just use -u
without -p. In fact, I think ruby on rails might require this, but I
don't remember exactly.
Subject: Re: MySQL Password Issue
From: linuxga-ga on 08 May 2006 13:37 PDT
 
hello boombot-ga,

MySQl has great documentation. The docs specifically address your
question and is a common error. Without knowing your version of
MySQL..

http://dev.mysql.com/doc/refman/4.1/en/access-denied.html

"#

If you try to connect as root and get the following error, it means
that you do not have an row in the user table with a User column value
of 'root' and that mysqld cannot resolve the hostname for your client:

Access denied for user ''@'unknown' to database mysql

In this case, you must restart the server with the --skip-grant-tables
option and edit your /etc/hosts file or \windows\hosts file to add an
entry for your host."

so..you can get to your terminal and issue
cat /etc/hosts

and make sure "127.0.0.1     localhost   $the hostname"   is in there,
(where $the hostname is the name of your machine, ie..xyz.foo.com, or
xyz) if not

as root issue
shell> echo "127.0.0.1     localhost localhost.localdomain $hostname" >>/etc/hosts

to start mysql with the --skip-grant-tables option **i think, not too
familar with macs**

shell> /usr/local/mysql/bin/mysqld --skip-grant-tables


then you can try to get into mysql with
shell> mysql -u root mysql or shell> mysql -u root test

The document listed above should be able to answer the rest of your questions

good day
Subject: Re: MySQL Password Issue
From: boombot-ga on 11 May 2006 09:22 PDT
 
linux-ga's post is helpful, but my specific error doesn't seem to be
dealt with in the document, but only in the comments.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy