Solved

mysql -u root is not asking for password

Posted on 2009-07-16
3
719 Views
Last Modified: 2012-06-27
Hi
i have checked 2 databases.
One of them if i type mysql -u root , it will say Acess denyed
another one will take you to mysql console, which i guess is not right,
but cant figured out why this is giving trouble..
i have checked, i dont have any account with empty password.


mysql> select Host,User from mysql.user where password = '';
Empty set (0.00 sec)


mysql> select Host,user from mysql.user;
+--------------------------+------+
| Host                     | user |
+--------------------------+------+
| 127.0.0.1                | root |
| localhost                | root |
| mail.xxxxx.co.uk | root |
+--------------------------+------+
3 rows in set (0.00 sec)

then why its entering to mysql without password??

PS: from normal user accoutn if type, mysql -u root  , it will say access denyed, but if i login as root user, it would not ask for password,

what i am missing??

0
Comment
Question by:fosiul01
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
flob9 earned 500 total points
ID: 24867317
check in your my.cnf file and [client] section
depending on your system, other files could be used (/etc/mysql/debian.cnf on debian).
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24867330
My client section is this( there is not any password defined) :
[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock
0
 
LVL 29

Author Comment

by:fosiul01
ID: 24867345
Ohh i know why

in home directory of root, for some reason , there is a file call .my.cnf!!!

dont understand why.. it might be webmin did that
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now