Solved

mysql -u root is not asking for password

Posted on 2009-07-16
3
737 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

705 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