[MDEV-9729] strange mariadb server auth behavior Created: 2016-03-15  Updated: 2016-04-14  Resolved: 2016-04-14

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.1.12
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: chen yuanyuan Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

Centos 7


Attachments: File mariadb.spec    

 Description   

I have build a rpm from mariadb tarball. When I install it from cent os 7.I encount the following strange behavior :

MariaDB [(none)]> show grants for lcs;
+----------------------------------------------------------------------------------------------------+
| Grants for lcs@%                                                                                   |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'lcs'@'%' IDENTIFIED BY PASSWORD '*C2ECDF0BCD9219C43E8C4781BF515F8F9429EA82' |
| GRANT ALL PRIVILEGES ON `lcsdb`.* TO 'lcs'@'%'                                                     |
+----------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
 
MariaDB [(none)]> quit
Bye
[root@localhost code]# /usr/local/mysql/bin/mysql -ulcs 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 542
Server version: 10.1.12-MariaDB Source distribution
 
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> 
[root@localhost code]# /usr/local/mysql/bin/mysql -ulcs  -plcs
ERROR 1045 (28000): Access denied for user 'lcs'@'localhost' (using password: YES)

So I have create a user with a password,but I can login without it,moreover,if I try to login with the correct pwd,it fails.

If I delete the mariadb data dir(/var/lib/mysql) and reinstall the rpm,then everything is normal.



 Comments   
Comment by Elena Stepanova [ 2016-03-15 ]

Please run

SELECT user, host from mysql.user

to check if you have the anonymous user ''@localhost. If you do, you need to remove it. When you log in, the anonymous user with specified host (localhost) takes priority over a named user without a specified host, that's an ancient and rather obscure MySQL feature.

Comment by Elena Stepanova [ 2016-04-14 ]

Please comment to re-open if you have more information on the issue.

Generated at Thu Feb 08 07:36:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.