2

I have installed Debian 9 only last week and installed the MySQL that comes with the distro:

# mysql                                        
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

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

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

So - I can connect without problems like that. However, I can't connect over TCP at all (don't worry about the password, it is only a demo one):

# mysql -h127.0.0.1 -uroot -pAtauseq01         
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

The same happens if I create a new user:

# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

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)]> create user 'jan'@'localhost' identified by 'Atauseq01';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant usage on *.* to 'jan'@'localhost';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on *.* to 'jan'@'localhost' with grant option;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> Bye
# mysql -h127.0.0.1 -ujan@localhost -pAtauseq01
ERROR 1045 (28000): Access denied for user 'jan@localhost'@'localhost' (using password: YES)

I have changed the bind address:

bind-address            = 0.0.0.0

And netstat -nap shows MySQL listening on 0.0.0.0:3306. Unfortunately the logs show no detail; mysqld's error log shows nothing at all, and various client tell me no more than 'access denied'. Also, telnet localhost 3306 actually gets a connection, so I know I get that far, at least.

Is there any way to get the MySQL log to show more detail?

Cœur
  • 37,241
  • 25
  • 195
  • 267
j4nd3r53n
  • 680
  • 2
  • 11
  • 26
  • 1
    Don't use `@localhost` on your commandline. Use `mysql -h127.0.0.1 -ujan -pAtauseq01` instead. – aynber Feb 05 '18 at 15:03
  • Argh! Have I been that stupid? I'll check when I get home – j4nd3r53n Feb 06 '18 at 13:43
  • 1
    You were right. *grumble grumble*. Thank you for shedding light on this. Well, they say best minds make the biggest mistakes, so I must be astonishingly clever, no doubt :-) – j4nd3r53n Feb 06 '18 at 14:05
  • Sometimes when you stare at something too long, you just need a fresh pair of eyes. I keep mine in a jar on my desk. :-D – aynber Feb 06 '18 at 14:41
  • 2
    Please check https://stackoverflow.com/a/40291452/596021 for the solution. – Huseyin Jul 20 '18 at 15:04

1 Answers1

0

I've decided to "answer" my own question - really the answer is due to aynber in the comments, but I guess he was too modest to post it as an answer:

Don't use @localhost on your commandline. Use mysql -h127.0.0.1 -ujan -pAtauseq01 instead

Also, see the comment by Huseyin.

j4nd3r53n
  • 680
  • 2
  • 11
  • 26