Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I am root, "mysql" connects without a password, even though I've set one:

# mysqladmin -u root password 'whatever'
# mysql -u root -p
Enter password: (typing the 'whatever' above)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.22-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> Bye

but unfortunately this also happens...

# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 4.1.22-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 

So even though I've set the password, and it IS checked when I use "-p", it is however not necessary!?!?

EDIT: It was my .my.cnf, it had the login password inside it. Removed it, all OK.

share|improve this question
1  
Add your "Edit" as answer please. –  Lekensteyn Jun 11 '11 at 9:51
    
Cross-post: webmasters.stackexchange.com/q/15130/6597 –  Lekensteyn Jun 11 '11 at 9:52
    
Do you have "skip-grant-tables" enabled in your my.cnf file? –  server_knuckle_dragger Jun 11 '11 at 14:54

1 Answer 1

Maybe you have user credentials in your ~/.my.cnf

[client]
user=john
password=smith
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.