?
Solved

mysql -u root is not asking for password

Posted on 2009-07-16
3
Medium Priority
?
746 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 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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