Solved

mysql -u root is not asking for password

Posted on 2009-07-16
3
726 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

770 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