Link to home
Start Free TrialLog in
Avatar of fosiul01
fosiul01Flag for United Kingdom of Great Britain and Northern Ireland

asked on

mysql -u root is not asking for password

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??

ASKER CERTIFIED SOLUTION
Avatar of flob9
flob9
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fosiul01

ASKER

My client section is this( there is not any password defined) :
[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock
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