[Maria-discuss] Is this normal behaviour?
![](https://secure.gravatar.com/avatar/5ed78e100fad32004e9d5066ac6b3efe.jpg?s=120&d=mm&r=g)
All, When I tried to connect in centos 7 mariadb 10.2.11 server using root user, by mistake I gave wrong user name, but it connected successfully. I am not sure why. When I check show databases, it didnt list all DBs, but when I connect with root again, I can see all valid Dbs. Is this normal that even if I give wrong user, it authenticate into DB server from root. [root@ipaddr ~]# mysql -u rot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.2.11-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec) MariaDB [(none)]> exit Bye [root@ipaddr~]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 24 Server version: 10.2.11-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | mydb01 | | information_schema | | mydb02 | | mysql | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec)
![](https://secure.gravatar.com/avatar/06fb7e7f8217ef0e572a8334567b7559.jpg?s=120&d=mm&r=g)
Check table mysql.user: you probably have the account '%'@localhost. It's a pattern, and rot@localhost matches.When running SHOW DATABASES you see only the databases which you have some permissions.
Federico
Da: Karthick Subramanian
![](https://secure.gravatar.com/avatar/5ed78e100fad32004e9d5066ac6b3efe.jpg?s=120&d=mm&r=g)
Thank you.
I noticed some anonymous user entries in mysql.user. I have executed the
mysql_secure_installation and removed those users as well.
On Thu, Jan 4, 2018 at 1:03 PM, Federico Razzoli
Check table mysql.user: you probably have the account '%'@localhost. It's a pattern, and rot@localhost matches. When running SHOW DATABASES you see only the databases which you have some permissions.
Federico
------------------------------ *Da:* Karthick Subramanian
*A:* Maria Discuss *Inviato:* Giovedì 4 Gennaio 2018 6:01 *Oggetto:* [Maria-discuss] Is this normal behaviour? All,
When I tried to connect in centos 7 mariadb 10.2.11 server using root user, by mistake I gave wrong user name, but it connected successfully. I am not sure why. When I check show databases, it didnt list all DBs, but when I connect with root again, I can see all valid Dbs.
Is this normal that even if I give wrong user, it authenticate into DB server from root.
[root@ipaddr ~]# mysql -u rot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec)
MariaDB [(none)]> exit Bye [root@ipaddr~]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 24 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | mydb01 | | information_schema | | mydb02 | | mysql | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec)
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
![](https://secure.gravatar.com/avatar/01d86d32e4a72ce9ecd34dba70b74cc4.jpg?s=120&d=mm&r=g)
Hi, it might be because of socket authentication plugin: https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/ In other words if you use "root" unix account you don't need password. Best regards Guillaume Lefranc Signal 18 Le jeu. 4 janv. 2018 à 09:20, Karthick Subramanian < ksubramanian@paycommerce.com> a écrit :
Thank you.
I noticed some anonymous user entries in mysql.user. I have executed the mysql_secure_installation and removed those users as well.
On Thu, Jan 4, 2018 at 1:03 PM, Federico Razzoli
wrote: Check table mysql.user: you probably have the account '%'@localhost. It's a pattern, and rot@localhost matches. When running SHOW DATABASES you see only the databases which you have some permissions.
Federico
------------------------------ *Da:* Karthick Subramanian
*A:* Maria Discuss *Inviato:* Giovedì 4 Gennaio 2018 6:01 *Oggetto:* [Maria-discuss] Is this normal behaviour? All,
When I tried to connect in centos 7 mariadb 10.2.11 server using root user, by mistake I gave wrong user name, but it connected successfully. I am not sure why. When I check show databases, it didnt list all DBs, but when I connect with root again, I can see all valid Dbs.
Is this normal that even if I give wrong user, it authenticate into DB server from root.
[root@ipaddr ~]# mysql -u rot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec)
MariaDB [(none)]> exit Bye [root@ipaddr~]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 24 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | mydb01 | | information_schema | | mydb02 | | mysql | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec)
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
![](https://secure.gravatar.com/avatar/359652f5d5394fdc76fea714c0e40c97.jpg?s=120&d=mm&r=g)
Am 04.01.2018 um 17:56 schrieb Guillaume Lefranc:
it might be because of socket authentication plugin:
https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/
In other words if you use "root" unix account you don't need password.
then he would have seen the "mysql" database in "show databases"
Le jeu. 4 janv. 2018 à 09:20, Karthick Subramanian
mailto:ksubramanian@paycommerce.com> a écrit : Thank you.
I noticed some anonymous user entries in mysql.user. I have executed the mysql_secure_installation and removed those users as well.
On Thu, Jan 4, 2018 at 1:03 PM, Federico Razzoli
mailto:federico_raz@yahoo.it> wrote: Check table mysql.user: you probably have the account '%'@localhost. It's a pattern, and rot@localhost matches. When running SHOW DATABASES you see only the databases which you have some permissions.
Federico
------------------------------------------------------------------------ *Da:* Karthick Subramanian
mailto:ksubramanian@paycommerce.com> *A:* Maria Discuss mailto:maria-discuss@lists.launchpad.net> *Inviato:* Giovedì 4 Gennaio 2018 6:01 *Oggetto:* [Maria-discuss] Is this normal behaviour? All,
When I tried to connect in centos 7 mariadb 10.2.11 server using root user, by mistake I gave wrong user name, but it connected successfully. I am not sure why. When I check show databases, it didnt list all DBs, but when I connect with root again, I can see all valid Dbs.
Is this normal that even if I give wrong user, it authenticate into DB server from root.
[root@ipaddr ~]# mysql -u rot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec)
MariaDB [(none)]> exit Bye [root@ipaddr~]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 24 Server version: 10.2.11-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | mydb01 | | information_schema | | mydb02 | | mysql | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec)
participants (4)
-
Federico Razzoli
-
Guillaume Lefranc
-
Karthick Subramanian
-
Reindl Harald