#1698 - Access denied for user 'root'@'localhost'

Discussion in 'Installation/Configuration' started by zustudios, Aug 25, 2017.

  1. zustudios

    zustudios Member

    This is a fresh install of ispconfig 3.1 on ubuntu 16.04.
    When I try to sign in as the root user on phpmyadmin I get:
    #1698 - Access denied for user 'root'@'localhost'

    root@ns1:~# wget -q -O htf-common-issues.php "http://gitplace.net/pixcept/ispconfig-tools/raw/stable/htf-common-issues.php" && php -q htf-common-issues.php

    ##### SCRIPT FINISHED #####
    Results can be found in htf_report.txt
    To view results use your favourite text editor or type 'cat htf_report.txt | more' on the server console.

    If you want to see the non-anonymized output start the script with --debug as parameter (php -q htf-common-issues.php --debug).

    root@ns1:~# cat htf_report.txt | more

    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    IP-address(es) (as per ifconfig): ***.***.***.***
    [WARN] ip addresses from hostname differ from ifconfig output. Please check your
    ip settings.
    [INFO] ISPConfig is installed.

    ##### ISPCONFIG #####
    ISPConfig version is 3.1dev


    ##### VERSION CHECK #####

    [INFO] php (cli) version is 7.0.22-0ubuntu***.***.***.***

    ##### PORT CHECK #####


    ##### MAIL SERVER CHECK #####


    ##### RUNNING SERVER PROCESSES #####

    [INFO] I found the following web server(s):
    Apache 2 (PID 1627)
    [INFO] I found the following mail server(s):
    Postfix (PID 1905)
    [INFO] I found the following pop3 server(s):
    Dovecot (PID 1331)
    [INFO] I found the following imap server(s):
    Dovecot (PID 1331)
    [INFO] I found the following ftp server(s):
    PureFTP (PID 1857)

    ##### LISTENING PORTS #####
    (only ()
    Local (Address)
    [localhost]:10023 (1451/postgrey.pid)
    [localhost]:10024 (2327/amavisd-new)
    [localhost]:10025 (1905/master)
    [localhost]:10026 (2327/amavisd-new)
    [localhost]:10027 (1905/master)
    [anywhere]:587 (1905/master)
    [localhost]:11211 (1268/memcached)
    [anywhere]:110 (1331/dovecot)
    [anywhere]:143 (1331/dovecot)
    [anywhere]:465 (1905/master)
    [anywhere]:21 (1857/pure-ftpd)
    ***.***.***.***:53 (1202/named)
    [localhost]:53 (1202/named)
    [anywhere]:22 (1200/sshd)
    [anywhere]:25 (1905/master)
    [localhost]:953 (1202/named)
    [anywhere]:993 (1331/dovecot)
    [anywhere]:995 (1331/dovecot)
    *:*:*:*::*:10023 (1451/postgrey.pid)
    *:*:*:*::*:10024 (2327/amavisd-new)
    *:*:*:*::*:10026 (2327/amavisd-new)
    *:*:*:*::*:3306 (1617/mysqld)
    *:*:*:*::*:587 (1905/master)
    [localhost]10 (1331/dovecot)
    [localhost]43 (1331/dovecot)
    *:*:*:*::*:8080 (1627/apache2)
    *:*:*:*::*:80 (1627/apache2)
    *:*:*:*::*:465 (1905/master)
    *:*:*:*::*:8081 (1627/apache2)
    *:*:*:*::*:21 (1857/pure-ftpd)
    *:*:*:*::*:53 (1202/named)
    *:*:*:*::*:22 (1200/sshd)
    *:*:*:*::*:25 (1905/master)
    *:*:*:*::*:953 (1202/named)
    *:*:*:*::*:443 (1627/apache2)
    *:*:*:*::*:993 (1331/dovecot)
    *:*:*:*::*:995 (1331/dovecot)




    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    f2b-dovecot-pop3imap tcp -- [anywhere]/0 [anywhere]/0 mu
    ltiport dports 110,995,143,993
    f2b-pureftpd tcp -- [anywhere]/0 [anywhere]/0 multiport
    dports 21
    f2b-postfix-sasl tcp -- [anywhere]/0 [anywhere]/0 multip
    ort dports 25
    f2b-sshd tcp -- [anywhere]/0 [anywhere]/0 multiport dpo
    rts 22

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Chain f2b-dovecot-pop3imap (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-postfix-sasl (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-pureftpd (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-sshd (1 references)
    target prot opt source destination
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with ic
    mp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icm
    p-port-unreachable
    RETURN all -- [anywhere]/0 [anywhere]/0
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Are you able to login to MySQL on the shell with:

    mysql -u root -h localhost -p

    the command will ask for the password then.
     
  3. zustudios

    zustudios Member

    I'm able to login on the terminal but I still can't login to phpmyadmin.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Debian and Ubuntu changed the way that MySQL and MariaDB are using to authenticate the root user which causes phpmyadmin login to fail. To get the same auth setup that was used on older Ubuntu and Debian versions back (which works with phpmyadmin), follow these steps:

    Set the password authentication method in MariaDB to native so we can use PHPMyAdmin later to connect as root user:

    Code:
    echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root
    Edit the file /etc/mysql/debian.cnf and set the MYSQL / MariaDB root password there twice in the rows that start with password.

    Code:
    nano /etc/mysql/debian.cnf
    The MySQL root password that needs to be added is shown in read, in this example the password is "howtoforge".

    Code:
    # Automatically generated for Debian scripts. DO NOT TOUCH!
    [client]
    host = localhost
    user = root
    password = howtoforge
    socket = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host = localhost
    user = root
    password = howtoforge
    socket = /var/run/mysqld/mysqld.sock
    basedir = /usr
    Then we restart MariaDB:

    Code:
    service mysql restart
     
  5. zustudios

    zustudios Member

    OK. Thank you. I understand. I already created a 2nd root user and I'm able to login phpmyadmin.
     

Share This Page