0

I'm already too tired of trying so many different things and I can't even bypass an error which is running. I know some of you might think it's a duplicate question, but I've seen dozens of questions, so I don't think the answer is so simple, nor is duplicated.


This are some of the many solutions I unsuccessfully tried:

update command is denied for user

Can't change user password on MySQL using UPDATE

Error: select command denied to user '<userid>'@'<ip-address>' for table '<table-name>'

MySQL Error: #1142 - SELECT command denied to user

https://mariadb.com/kb/en/set-password/

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

https://forums.mysql.com/read.php?10,588296

https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html


# mysql -u root -p

when it asks for password, no matter what I type it shows

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 430
Server version: 10.3.23-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

show databases; only shows

+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.002 sec)

when I type

MariaDB [(none)]> use mysql;
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'mysql'

Notice it says % instead of localhost, is that a hint of something going on? have you encountered the same problem and were able to solve that?


even if I type the right password. I have another user but I can't change its password.


MariaDB [(none)]> select user, plugin from user;

shows

ERROR 1046 (3D000): No database selected

I feel like I really tried everything, I mean I've been like this for so many hours now, and I've changed mysql passwords many times in the past, using console in windows and linux, I have no idea what's going on!


EIDT: as suggested in comments here is the output for SELECT user, host, plugin from mysql.user;

MariaDB [(none)]> SELECT user, host, plugin from mysql.user;
ERROR 1142 (42000): SELECT command denied to user 'root'@'localhost' for table 'user'

here's the output to > SHOW GRANTS;

MariaDB [(none)]> SHOW GRANTS;
+---------------------------------------------------------------------------------------------------------------+
| Grants for root@%                                                                                             |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `root`@`%` IDENTIFIED VIA unix_socket USING '*227A46552108541F24FF4915F91'              |
+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)

newbie
  • 1,199
  • 1
  • 10
  • 25
  • Try `SELECT user, host, plugin from mysql.user`. – aynber Sep 30 '20 at 13:39
  • Hi, @aynber I thought I posted about accessing that table. Edited the question, I can't access mysql.user either, – newbie Sep 30 '20 at 13:47
  • 1
    It sounds like something is messed up with your permissions, since root appears to only have usage instead of all privileges. This is a bit beyond me, but https://stackoverflow.com/questions/1709078/how-can-i-restore-the-mysql-root-user-s-full-privileges might be of some help – aynber Sep 30 '20 at 13:53
  • if you have a backup use it to restore your system. – nbk Sep 30 '20 at 13:56

0 Answers0