• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 766
  • Last Modified:

mysql -u root is not asking for password

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

  • 2
1 Solution
check in your my.cnf file and [client] section
depending on your system, other files could be used (/etc/mysql/debian.cnf on debian).
fosiul01Author Commented:
My client section is this( there is not any password defined) :
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock
fosiul01Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now