LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-20-2007, 08:33 AM   #1
swmok
Member
 
Registered: Jul 2003
Posts: 152

Rep: Reputation: 30
Cannot login to mysql


Hi:
I've just install mysql 5 in my system.
Later I set the root password by

mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password='mypassword' WHERE user='root';
mysql> FLUSH PRIVILEGES;

Then I exit the mysql. However, I cannot login again.
When I type:

mysql -u root -p
[type in the mypassword]

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

What can I do?
How to reset the root password in mysql?

Thanks.
 
Old 06-20-2007, 03:18 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You should have done:
password = password("mypassword")
 
Old 06-20-2007, 07:02 PM   #3
swmok
Member
 
Registered: Jul 2003
Posts: 152

Original Poster
Rep: Reputation: 30
Do you mean
UPDATE user SET Password='mypassword' WHERE user='root';
is not correct?

It should be:
UPDATE user SET password='mypassword' WHERE user='root';
??

Thus, the password has not been set???
So, what should I do now??
Thanks.
 
Old 06-20-2007, 11:02 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
The command you should have issued was:
UPDATE user SET password=password('mypassword') WHERE user='root';

This inserts the password hash into the user table. Unfortunately, the command that you issued set the hash to "mypassword". You might try doing a Google search for restarting with the --skip-grant-tables flag.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot login in MYSQL rajeshdogra Linux - Software 9 01-01-2006 09:15 AM
Can not login into mysql. saudoi Solaris / OpenSolaris 1 11-30-2005 02:20 AM
mysql login Ab3n Linux - Newbie 2 07-04-2005 10:45 AM
Mysql all users can login huscvarna Linux - Software 1 02-16-2005 06:16 AM
mysql login sopiaz57 Linux - Security 1 01-05-2004 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration