LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-30-2003, 06:58 PM   #1
TastyWheat
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Knoppix 5.0.1, Fedora Core 5
Posts: 66

Rep: Reputation: 15
mySQL Not Accepting Password


Among many other problems I'm having with mySQL, I get an "access denied" message whenever I try to run mysql as root. I'm using a password for root, but I know I updated it correctly and I know I'm retyping it correctly. I also set root@localhost to have all privileges so that shouldn't be a problem. I think there's other issues here. Any ideas?

Last edited by TastyWheat; 08-30-2003 at 07:00 PM.
 
Old 08-31-2003, 09:26 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Well, if you set up mySQL correctly when you first installed(following these instructions), you could try resetting roots password.

However, one of the other common issues is that the files in /var/lib/mysql have root as the owner. Check those and if root does own them, chown them to mysql.
 
Old 09-01-2003, 01:08 AM   #3
TastyWheat
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Knoppix 5.0.1, Fedora Core 5
Posts: 66

Original Poster
Rep: Reputation: 15
Well, the directory & file ownership is set correctly. I also changed the password several times using the first method in the instructions. I couldn't use mysqladmin to change anything though. I keep getting an "Access denied" message for root@localhost. I know I'm typing in the right password though, I'm not retarded. The problem is definitely privilege related though. If I set 'skip-grant-tables' then I can use mysql and phpMyAdmin with no problems.

BTW: I'm also having trouble restricting access to my site using 'mod_auth' and apache.
 
Old 09-01-2003, 08:44 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
You're going to have to provide a bit more explanation about what is happening when you try to log in. Sorry, but "Access Denied" is too broad an error message to do any diagnosis on. So, what command are you using to start mysql, what is the full error message and what does your mySQL log show?

As for the mod_auth, I'm afraid I have no idea. I'm still struggling with apache basics, so you might want to start another thread about that question.

Last edited by Hangdog42; 09-01-2003 at 08:45 AM.
 
Old 09-01-2003, 12:15 PM   #5
TastyWheat
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Knoppix 5.0.1, Fedora Core 5
Posts: 66

Original Poster
Rep: Reputation: 15
Here's what happens on the command line (under normal configuration):

>mysql -u root mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

>mysql -u root -p=my_password mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

>mysqladmin -u root version
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO) '

>mysqladmin -u root -p=my_password version
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES) '

If I include the 'skip-grant-tables' option in the /etc/my.cnf file then the above commands work just fine. Having a setup like that isn't secure of course. Is there a way I can remove the passwords to see if that's where the problem is?
 
Old 09-01-2003, 03:18 PM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I'd still have a look in your mySQL error log (you'll have to find it. It's called hostname.err where hostname is the name you gave your computer and is usually either in /usr/local/var or /usr/local/mysql/data) and see if mysqld is complaining about anything when it starts up.

Also, I've got a syntax question. In almost all of your logins, you have something like -p=my_password. Do you actually use the = ? If you are, it may be screwing you up. When I provide the password on the command line I usually do something like

mysql -u root -prootpassword

Note that there is no space between the -p flag and the password. The other thing to try is the -p flag without any arguments (mysql -u root -p). MySQL shoudl then prompt you for a password. Enter it and see if that works.

And a final thought. I saw this thread where the guy was pulling out his hair for a similar error message. It turns out he had a reserved character (&%#@) in his password. As soon as he changed to a password that didn't have one, mysql worked fine.

Last edited by Hangdog42; 09-01-2003 at 03:21 PM.
 
Old 09-01-2003, 11:19 PM   #7
TastyWheat
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Knoppix 5.0.1, Fedora Core 5
Posts: 66

Original Poster
Rep: Reputation: 15
Well, I'm not really sure why I added the '=' but I wouldn't have guessed the '-p' would have to be touching the password. In other words it works now. I'm still having a problem with phpMyAdmin, but that should probably be a different thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Recover MySQL password wwnexc Linux - Security 2 10-16-2005 02:08 PM
MYSQL will not take my password number11 Slackware 4 04-23-2005 07:48 AM
Help! ssh to home desktop is listening but not accepting password vrooje Linux - General 10 01-02-2005 09:22 PM
mysql + password ethanchic Linux - Software 5 02-03-2003 07:06 PM
sshd not accepting password Ionized Linux - Networking 2 08-06-2002 01:01 PM

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

All times are GMT -5. The time now is 09:40 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