Phpmyadmin does not connect to Mysql server

Discussion in 'Installation/Configuration' started by Bashewa, Feb 20, 2011.

  1. Bashewa

    Bashewa Member

    Hi Ive installed ISPconfig3 on Debian Squeeze on a dedicated server with 3 available IP's and everything works fine except for phpmyadmin.

    When I create a database I can access phpmyadmin from the ISPconfig panel by clicking the connection to phpmyadmin from the sites/database interface, but I cannot login with the username and password I just set up.


    I can login to mysql server from command line by doing

    mysql -u root -p

    so mysql server is running

    remote access is also ticked

    Ive set phpmyadmin interface on ISPconf to http://xx.xx.149.228/phpmyadmin/ which I can open but wont except username and password ( #1045 Cannot log in to the MySQL server
    )

    Any ideas how to start fault tracing?

    Thanks

    Alex
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the ouput of the command:

    netstat -tap
     
  3. Bashewa

    Bashewa Member

    Code:
    server1:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State                                                                                                         PID/Program name
    tcp        0      0 41.72.149.229:www       66.220.158.248:53256    SYN_RECV                                                                                                      -
    tcp        0      0 41.72.149.229:www       dsl-158-22.aei.ca:50492 SYN_RECV                                                                                                      -
    tcp        0      0 *:ftp                   *:*                     LISTEN                                                                                                        30386/pure-ftpd (SE
    tcp        0      0 41.72.149.230:domain    *:*                     LISTEN                                                                                                        29413/named
    tcp        0      0 41.72.149.229:domain    *:*                     LISTEN                                                                                                        29413/named
    tcp        0      0 server1.booknsta:domain *:*                     LISTEN                                                                                                        29413/named
    tcp        0      0 localhost:domain        *:*                     LISTEN                                                                                                        29413/named
    tcp        0      0 *:ssh                   *:*                     LISTEN                                                                                                        30110/sshd
    tcp        0      0 localhost:953           *:*                     LISTEN                                                                                                        29413/named
    tcp        0      0 *:smtp                  *:*                     LISTEN                                                                                                        18221/smtpd
    tcp        0      0 localhost:10024         *:*                     LISTEN                                                                                                        28539/amavisd (mast
    tcp        0      0 localhost:10025         *:*                     LISTEN                                                                                                        28453/master
    tcp        0      0 localhost:mysql         *:*                     LISTEN                                                                                                        16730/mysqld
    tcp        0      0 localhost:37403         localhost:mysql         ESTABLISHED                                                                                                   31428/amavisd (ch19
    tcp        0      0 localhost:55884         localhost:www           TIME_WAIT                                                                                                     -
    tcp        0      0 server1.booknstay.c:ssh u125.gpu93.samsun:40661 TIME_WAIT                                                                                                     -
    tcp        0      0 localhost:40110         localhost:domain        TIME_WAIT                                                                                                     -
    tcp        0      0 localhost:mysql         localhost:37403         ESTABLISHED                                                                                                   16730/mysqld
    tcp        0      0 localhost:mysql         localhost:37372         ESTABLISHED                                                                                                   16730/mysqld
    tcp        0    720 server1.booknstay.c:ssh u125.gpu93.samsun:43620 ESTABLISHED                                                                                                   18193/sshd: [accept
    tcp        0     52 server1.booknstay.c:ssh 41-134-160-57.dsl:10553 ESTABLISHED                                                                                                   18178/0
    tcp        0      0 localhost:37372         localhost:mysql         ESTABLISHED                                                                                                   30906/amavisd (ch19
    tcp        0      0 server1.booknstay.c:ssh 41-134-160-57.dsl:59900 ESTABLISHED                                                                                                   17171/sshd: root@no
    tcp        0      0 localhost:49492         localhost:ftp           TIME_WAIT                                                                                                     -
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN                                                                                                        29323/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN                                                                                                        29295/couriertcpd
    tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN                                                                                                        14591/apache2
    tcp6       0      0 [::]:www                [::]:*                  LISTEN                                                                                                        14591/apache2
    tcp6       0      0 [::]:tproxy             [::]:*                  LISTEN                                                                                                        14591/apache2
    tcp6       0      0 [::]:ftp                [::]:*                  LISTEN                                                                                                        30386/pure-ftpd (SE
    tcp6       0      0 [::]:domain             [::]:*                  LISTEN                                                                                                        29413/named
    tcp6       0      0 [::]:ssh                [::]:*                  LISTEN                                                                                                        30110/sshd
    tcp6       0      0 ip6-localhost:953       [::]:*                  LISTEN                                                                                                        29413/named
    tcp6       0      0 [::]:https              [::]:*                  LISTEN                                                                                                        14591/apache2
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN                                                                                                        29312/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN                                                                                                        29340/couriertcpd
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4931 ESTABLISHED                                                                                                   18129/apache2
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4929 ESTABLISHED                                                                                                   18164/apache2
    tcp6       0      0 41.72.149.229%32197:www vc-41-26-242-9.umt:4514 FIN_WAIT2                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63328 ESTABLISHED                                                                                                   18191/apache2
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55121 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www crawl-66-249-71-1:43108 ESTABLISHED                                                                                                   17913/apache2
    tcp6       0      0 41.72.149.230%32197:www b3090768.crawl.ya:52532 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4937 ESTABLISHED                                                                                                   18122/apache2
    tcp6       0      0 41.72.149.229%32197:www llf320049.crawl.y:32855 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4927 ESTABLISHED                                                                                                   18242/apache2
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55119 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55119 TIME_WAIT                                                                                                     -
    tcp6       0   1905 41.72.149.229%32197:www 196.214.92.50%169:2552  ESTABLISHED                                                                                                   -
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63329 ESTABLISHED                                                                                                   18192/apache2
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63326 ESTABLISHED                                                                                                   18190/apache2
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55120 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4939 ESTABLISHED                                                                                                   18091/apache2
    tcp6       0      0 41.72.149.229%32197:www cpe-76-174-216-94:59501 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63327 ESTABLISHED                                                                                                   17899/apache2
    tcp6       0      0 41.72.149.229%32197:www llf320049.crawl.y:58295 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-158-22.aei.ca:50568 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63325 ESTABLISHED                                                                                                   18165/apache2
    tcp6       0      0 41.72.149.229%32197:www cpe-76-174-216-94:59500 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55118 TIME_WAIT                                                                                                     -
    tcp6       0   6185 41.72.149.229%32197:www 196.214.92.50%170:2551  ESTABLISHED                                                                                                   -
    tcp6       0      0 server1.booknstay.:pop3 41-134-160-57.dsl:60003 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.230%3219:pop3 41-134-160-57.dsl:60002 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4935 ESTABLISHED                                                                                                   18167/apache2
    tcp6       0  21906 41.72.149.229%32197:www 196.214.92.50%170:2559  ESTABLISHED                                                                                                   -
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55117 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-146-232-167.te:4933 ESTABLISHED                                                                                                   18032/apache2
    tcp6       0      0 41.72.149.229%32197:www host86-144-223-72:63330 ESTABLISHED                                                                                                   18241/apache2
    tcp6       0      0 41.72.149.229%3219:pop3 41-134-160-57.dsl:60000 TIME_WAIT                                                                                                     -
    tcp6       0   6908 41.72.149.229%32197:www vc-41-2-188-185.u:50954 ESTABLISHED                                                                                                   18162/apache2
    tcp6       0      0 41.72.149.229%3219:pop3 41-134-160-57.dsl:60004 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.229%32197:www dsl-145-84-134.te:55111 TIME_WAIT                                                                                                     -
    tcp6       0   1079 41.72.149.229%32197:www vc-41-2-188-185.u:50958 ESTABLISHED                                                                                                   18114/apache2
    tcp6       0   6042 41.72.149.229%32197:www 196.214.92.50%171:2560  ESTABLISHED                                                                                                   -
    tcp6       0      0 41.72.149.229%3219:pop3 41-134-160-57.dsl:60006 TIME_WAIT                                                                                                     -
    tcp6       0      0 41.72.149.230%3219:pop3 41-134-160-57.dsl:60005 TIME_WAIT                                                                                                     -
    tcp6       0   6924 41.72.149.229%32197:www 196.214.92.50%169:2558  ESTABLISHED                                                                                                   -
    tcp6       0      1 41.72.149.229%32197:www out-fc247.tfbnw.n:44792 LAST_ACK                                                                                                      -
    tcp6       0      0 41.72.149.230%3219:pop3 41-134-160-57.dsl:60005 TIME_WAIT                                                                                                     -
    tcp6       0   6924 41.72.149.229%32197:www 196.214.92.50%170:2558  ESTABLISHED                                                                                                   -
    tcp6       0   1622 41.72.149.229%32197:www vc-41-2-188-185.u:50972 ESTABLISHED
    
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Code:
    tcp        0      0 localhost:mysql         *:*                     LISTEN                                                                                                        16730/mysqld
    
    MySQL is listening only on localhost. Can you change it so that it listens on all interfaces?
     
  5. Bashewa

    Bashewa Member

    Ok I have done that, but still receive a

    #1045 Cannot log in to the MySQL server error

    mysql> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | c1test1 |
    | dbispconfig |
    | mysql |
    +--------------------+
    4 rows in set (0.00 sec)

    The c1test1 db is what I created and cannot log into


    Below done after doing #bind-address = 127.0.0.1 at mysql/my.cnf

    server1:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:ftp *:* LISTEN 30386/pure-ftpd (SE
    tcp 0 0 41.72.149.230:domain *:* LISTEN 29413/named
    tcp 0 0 41.72.149.229:domain *:* LISTEN 29413/named
    tcp 0 0 server1.booknsta:domain *:* LISTEN 29413/named
    tcp 0 0 localhost:domain *:* LISTEN 29413/named
    tcp 0 0 *:ssh *:* LISTEN 30110/sshd
    tcp 0 0 localhost:953 *:* LISTEN 29413/named
    tcp 0 0 *:smtp *:* LISTEN 26410/smtpd
    tcp 0 0 localhost:10024 *:* LISTEN 28539/amavisd (mast
    tcp 0 0 localhost:10025 *:* LISTEN 28453/master
    tcp 0 0 *:mysql *:* LISTEN 26602/mysqld
    tcp 0 0 localhost:48158 localhost:domain TIME_WAIT -
    tcp 1 0 localhost:50462 localhost:mysql CLOSE_WAIT 30223/amavisd (ch15
    tcp 1 0 localhost:41943 localhost:mysql CLOSE_WAIT 30573/amavisd (ch15
    tcp 0 0 localhost:mysql localhost:50462 FIN_WAIT2 -
    tcp 0 0 localhost:57973 localhost:ftp TIME_WAIT -
    tcp 0 52 server1.booknstay.c:ssh 41-134-160-57.dsl.:3611 ESTABLISHED 26348/0
    tcp 0 0 localhost:42744 localhost:www TIME_WAIT -
    tcp 0 0 server1.booknstay.c:ssh 41-134-160-57.dsl:57621 ESTABLISHED 26345/sshd: root@no
    tcp 0 0 localhost:mysql localhost:41943 FIN_WAIT2 -
    tcp6 0 0 [::]:pop3 [::]:* LISTEN 29323/couriertcpd
    tcp6 0 0 [::]:imap2 [::]:* LISTEN 29295/couriertcpd
    tcp6 0 0 [::]:http-alt [::]:* LISTEN 14591/apache2
    tcp6 0 0 [::]:www [::]:* LISTEN 14591/apache2
    tcp6 0 0 [::]:tproxy [::]:* LISTEN 14591/apache2
    tcp6 0 0 [::]:ftp [::]:* LISTEN 30386/pure-ftpd (SE
    tcp6 0 0 [::]:domain [::]:* LISTEN 29413/named
    tcp6 0 0 [::]:ssh [::]:* LISTEN 30110/sshd
    tcp6 0 0 ip6-localhost:953 [::]:* LISTEN 29413/named
    tcp6 0 0 [::]:https [::]:* LISTEN 14591/apache2
    tcp6 0 0 [::]:imaps [::]:* LISTEN 29312/couriertcpd
    tcp6 0 0 [::]:pop3s [::]:* LISTEN 29340/couriertcpd
    tcp6 0 0 41.72.149.229%32159:www adsl-36-0-47.asm.:50734 ESTABLISHED 26145/apache2
    tcp6 0 0 41.72.149.229%32159:www adsl-36-0-47.asm.:50740 ESTABLISHED 26245/apache2
    tcp6 0 924 41.72.149.229%32159:www adsl-36-0-47.asm.:50737 ESTABLISHED 26246/apache2
    tcp6 0 0 41.72.149.229%32159:www adsl-36-0-47.asm.:50745 ESTABLISHED 26243/apache2
    tcp6 0 0 41.72.149.229%32159:www llf320049.crawl.y:48890 TIME_WAIT -
    tcp6 0 1190 41.72.149.229%32159:www adsl-36-0-47.asm.:50735 ESTABLISHED 26267/apache2
    tcp6 0 5748 41.72.149.229%32159:www adsl-36-0-47.asm.:50736 ESTABLISHED 26277/apache2
    tcp6 0 0 41.72.149.229%32159:www crawl-66-249-71-1:52333 ESTABLISHED 26044/apache2
    tcp6 0 0 41.72.149.229%32159:www llf320049.crawl.y:51543 TIME_WAIT -
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Does the MySQL password contain any special characters?
     
  7. Bashewa

    Bashewa Member

    no, only uppercase and lowercase numbers and letters
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Can you log in with the new username on the shell?

    Code:
    mysql -u [I]username[/I] -p
     
  9. Bashewa

    Bashewa Member

    Yes

    mysql> mysql -u c1test1 -p
    ->
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Did the password work?
     
  11. Bashewa

    Bashewa Member

    Yes password works.

    ( validated access by trying incorrect password )
     
  12. eko_taas

    eko_taas New Member

    My ISPConfig3 does not connect to phpmyadmin - what to check next

    sorry, mistake on posting, I put as new subject
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Hm, then I'm running out of ideas... :(
     
  14. Bashewa

    Bashewa Member

    Can I try purge and reinstall phpmyadmin, without creating dependency issues with ISPConfig and manage phpmyadmin ( mysql ) apart from ISP config?
     
  15. falko

    falko Super Moderator Howtoforge Staff

    Yes.

    What do you mean with that? You shouldn't change records created through ISPConfig in phpMyAdmin.
     
  16. Bashewa

    Bashewa Member

    Probably not the best solution, but am now managing mysql via the package from http://www.adminer.org/ , all passwords and databases where set up in ISPconfig and work fine, still in the dark as to why phpmyadmin couldnt log in:confused: . But for now I dont need phpmyadmin and am happy to work with adminer.
     
  17. (O)fer_cz

    (O)fer_cz New Member

    i have got same proble. I have phpmyadmin installed on my admin server and i wanna connect to my db server.
    error is: #1045 Cannot log in to the MySQL server

    proplem is, that i have phpmyadmin database only on server admin, not on server db.
    Can i somehow make phpmyadmin to authenticate users from database which is on admin?
    or thats not necessary?

    lgoin to localhost on admin works fine
    config on admin server is:

    <?php
    /**
    * Debian local configuration file
    *
    * This file overrides the settings made by phpMyAdmin interactive setup
    * utility.
    *
    * For example configuration see /usr/share/doc/phpmyadmin/examples/config.default.php.gz
    *
    * NOTE: do not add security sensitive data to this file (like passwords)
    * unless you really know what you're doing. If you do, any user that can
    * run PHP or CGI on your webserver will be able to read them. If you still
    * want to do this, make sure to properly secure the access to this file
    * (also on the filesystem level).
    */

    /**
    * Server(s) configuration
    */
    $i = 0;
    // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
    // You can disable a server config entry by setting host to ''.
    $i++;

    /**
    * Read configuration from dbconfig-common
    * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
    */
    if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require('/etc/phpmyadmin/config-db.php');
    }

    /* Configure according to dbconfig-common if enabled */
    if (!empty($dbname)) {
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    if (empty($dbserver)) $dbserver = 'localhost';
    $cfg['Servers'][$i]['host'] = $dbserver;

    if (!empty($dbport)) {
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['port'] = $dbport;
    }
    //$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    /* Optional: User for advanced features */
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;
    /* Optional: Advanced phpMyAdmin features */
    $cfg['Servers'][$i]['pmadb'] = $dbname;
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma_relation';
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    $cfg['Servers'][$i]['history'] = 'pma_history';
    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
    $cfg['Servers'][$i]['tracking'] = 'pma_tracking';

    /* Uncomment the following to enable logging in to passwordless accounts,
    * after taking note of the associated security risks. */
    // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

    /* Advance to next server for rest of config */
    $i++;
    }

    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = 'db.example.tld';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    //$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysql';
    /* Optional: User for advanced features */
    // $cfg['Servers'][$i]['controluser'] = 'pma';
    // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
    /* Optional: Advanced phpMyAdmin features */
    // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
    // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    // $cfg['Servers'][$i]['relation'] = 'pma_relation';
    // $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    // $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    // $cfg['Servers'][$i]['history'] = 'pma_history';
    // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
    /* Uncomment the following to enable logging in to passwordless accounts,
    * after taking note of the associated security risks. */
    // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

    /*
    * End of servers configuration
    */

    /*
    * Directories for saving/loading files from server
    */
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';
     
    Last edited: Oct 13, 2011
  18. falko

    falko Super Moderator Howtoforge Staff

  19. (O)fer_cz

    (O)fer_cz New Member

    its still not working, same problem...
    i have debian 6 and ispc 3.0.3.3 multiserver setup
     
  20. falko

    falko Super Moderator Howtoforge Staff

    Can you connect to the remote server from the command line?

    Code:
    mysql -h [I]<remote_server>[/I] -u root -p
     

Share This Page