1

I'm already too tired of trying so many different things and I can't even bypass an error which is running

# 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'

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!

EDIT:

As suggested in comments 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)

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'
6
  • While in the tool, do SHOW GRANTS; – Rick James Sep 30 '20 at 4:35
  • Hi @RickJames I edited my question. Thanks. – newbie Sep 30 '20 at 13:50
  • What about root@localhost? – Rick James Sep 30 '20 at 23:09
  • hello again @RickJames should I create that user? why? I already gave privilages to root@% that's the user I see when I log into phpmyadmin... I still can't solve mysql problems on the server! – newbie Sep 30 '20 at 23:25
  • The SHOW implies that you have no privileges for root@%. localhost requires that the client is on the same machine as the server. Exposing root@% is a big security breech. – Rick James Sep 30 '20 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.