Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Not a Bug
-
Affects Version/s: 5.5.25-galera
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Mageia Linux
Description
This is new instalation, no update
MariaDB [(none)]> create user dbuser identified by 'mysql';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant ALL privileges on . to 'dbuser'@'%';
Query OK, 0 rows affected (0.00 sec)
Then from the shell:
$ mysql -p -u dbuser
Enter password:
ERROR 1045 (28000): Access denied for user 'dbuser'@'localhost' (using password: YES)
I even created a valid Linux user with the name dbuser before adding it to database.
Log file is useless:
121122 09:49:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121122 9:49:11 InnoDB: The InnoDB memory heap is disabled
121122 9:49:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121122 9:49:11 InnoDB: Compressed tables use zlib 1.2.6
121122 9:49:11 InnoDB: Using Linux native AIO
121122 9:49:11 InnoDB: Initializing buffer pool, size = 128.0M
121122 9:49:11 InnoDB: Completed initialization of buffer pool
121122 9:49:11 InnoDB: highest supported file format is Barracuda.
121122 9:49:12 InnoDB: Waiting for the background threads to start
121122 9:49:13 Percona XtraDB (http://www.percona.com) 1.1.8-26.0 started; log sequence number 1776818
121122 9:49:13 [Note] Plugin 'PBXT' is disabled.
121122 9:49:13 [Note] Event Scheduler: Loaded 0 events
121122 9:49:13 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.25-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 Mageia - MariaDB Community Edition (GPL)
Nothing else ![]()
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
This is expected behavior. It is explained in the manual, as a "very common mistake".
You are connecting as dbuser@localhost. That is, you can see, that access is denied to dbuser@localhost. This happens, because you have the anonymous @localhost user, and MariaDB (and MySQL) sort accounts with a known host name before accounts with a wildcard (%) host name. And when you connect as dbuser@localhost it matches @localhost before it has a chance to match dbuser@%.
You need either to create a user dbuser@localhost, or remove the anonymous @localhost user.