0

I am quite a beginner with MySQL, but I already got problems with setting up a connection. I tried to use MySQL Workbench, but I can't connect to the server. I use SparkyLinux, a Debian-based distribution. Here is what I did so far :

  1. I created a user and checked that I could log in a console :

    adrien@sahelantropus:~$ mysql -u adrien -p
    
    Enter password: 
    
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 6
    Server version: 10.1.23-MariaDB-9+deb9u1 Debian 9.0
    
    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)]>

    (maybe it is interesting to notice I can either give my password or not, and log in with exactly the same output)

  2. I tried to setup a connection with MySQL Workbench, but when I test it, I get the following output :

    Failed to Connect to MySQL at 127.0.0.1:3306 with user adrien Access denied for user 'adrien'@'localhost'

  3. I tried to use MySQL Connector in Python, and got the following exception :

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

I am sorry if something obvious is going on and I cannot see it, and I thank anyone who could help me.

1 Answer 1

1

Probably mysql doesn't listen the TCP sockets at all and console client is connected via filesocket. Try to list all network sockets listened at your host:

ss -l | grep 3306

The other possibility is that you have turned skip_name_resolve variable ON that disable using of localhost instead of 127.0.0.1.

1
  • Thank you for your help. ss -l | grep 3306 gives no answer at all. Commented Jul 16, 2017 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.