Why is mysql automatically logging me in without .my.cnf or my.cnf sections?
I've checked and double checked that there is no user and password directive in /etc/my.cnf and ~/.my.cnf but it seems that every time I issue mysql it will drop me into the command line without prompting for a password or giving any pause. Of course, the only table I have access to when doing this is information_schema with read only on most of it and no access on the rest, but I was just wondering where else an auto-login style authentication could be coming from.
Thanks in advance, Alunduil |
Uh - maybe from not having defined a password for all users (most especially "root")?
Strong recommendation: Quote:
|
All users have a password set and just for good measure I removed some users that I don't use any longer. Any other ideas?
Regards, Alunduil |
Quote:
Please run this command, and cut/paste the results ("X" out any passwords from the post): Quote:
|
Here you go. Sorry it took so long it's been a hectic week.
Code:
alunduil@giskard ~ $ mysql -uroot -p mysql Alunduil |
Hi -
I'm confused :( It looks like it *did* prompt you for a password (it says "Enter Password:"). Do you think maybe you somehow inadvertantly made "<Enter>" a valid password? What happens if you *change* the root password? For whatever it's worth, here's how I usually go into the MySQL monitor: Quote:
'Hope that helps .. PSM |
Yes, but what I'm saying is as my user I'm able to issue the command: mysql (no options) and it will drop me at a prompt. That's the issue. When I specify a user and tell mysql (through the -p switch) to prompt me for the password of course it's going to.
I do understand the command you provided in your last post and the -uroot can have a space. You are able to pass -u root and mysql will parse it correctly. The same does not go for the password because if -p is found alone mysql prompts for the password (making it so shoulder surfers don't get what they are there for). I was thinking it might be a stray .my.cnf that was getting pulled in from my environment but I don't see anything like that. Regards, Alunduil |
Hi -
Actually, my understanding of the "-p" options was primarily to allow you to enter it in-line (and prevent wasting time responding to some silly "Enter Password:" prompt). Neither here nor there: a) if you entered "-p" with a valid password, you should get in (without being challenged, and without seeing an "Enter Password" prompt). b) I completely understand that your problem is that you don't seem to need a password in the first place (despite the fact that all users - including root - appear to have valid passwords). I'm still suggesting that maybe the root password somehow got set to "\n". Couldn't hurt to change it... You've absolutely confirmed that no MySql users have a null password - thank you. And you're absolutely correct: now that we seem to have ruled out just about everything else, some ".my.cnf" file somewhere in the environment is just about the only thing left that makes any sense. Q: have you tried all of the following commands: Quote:
|
Quote:
Edit: This will not be possible from any other system, then localhost. |
Sorry about my earlier frustrations. It seems after removing the extra users that you pointed out from your first post and then finally restarting mysql provided the desired effect. If this issue surfaces again I hope to get a better answer.
Thanks for all the patience and help everyone. Regards, Alunduil |
Also, Blue_Ice, here's the default behaviour on two separate boxes:
Code:
alunduil@dornick ~ $ mysql Code:
alunduil@giskard ~ $ mysql Alunduil |
Quote:
|
All times are GMT -5. The time now is 03:06 PM. |