The Perfect Setup - Debian Etch (Debian 4.0) mysql question

Discussion in 'HOWTO-Related Questions' started by paul55, Jul 9, 2007.

  1. paul55

    paul55 New Member

    Hi all i have just installed debian etch following that howto but i have a problem about configuring the mysql server.Exactly when i try to run
    Code:
     mysqladmin -h myhostname.mydomainname -u root password my-mysqlrootpassword
    i get this error:
    Code:
    mysqladmin: connect to server at 'medic3.medichome' failed
    error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 113'
    .The server is running
    Code:
    medic3:/home/paul555# ps -ef |grep mysql
    root      2154     1  0 15:29 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
    mysql     2191  2154  0 15:29 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
    root      2192  2154  0 15:29 ?        00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
    root      2648  2626  0 16:01 pts/0    00:00:00 grep mysql
    and i have created ok the root password previously with
    Code:
    mysqladmin -u root password my-mysqlrootpassword
    .Does anyone have an idea?
     
  2. planet_fox

    planet_fox Member HowtoForge Supporter

    Do this or reinstall mysql and do again
     
  3. paul55

    paul55 New Member

    I reinstall mysql and restarted it but still the same error
     
  4. planet_fox

    planet_fox Member HowtoForge Supporter

    hm what is when you do this

     
  5. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ?
     
  6. paul55

    paul55 New Member

    When i run
    Code:
    mysqladmin -h localhost -u root password myrootsqlpassword
    i get
    Code:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    but when i run
    Code:
    mysqladmin -hlocalhost -u root -p version
    it connects
    Code:
    mysqladmin  Ver 8.41 Distrib 5.0.32, for pc-linux-gnu on i486
    Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license
    
    Server version          5.0.32-Debian_7etch1-log
    Protocol version        10
    Connection              Localhost via UNIX socket
    UNIX socket             /var/run/mysqld/mysqld.sock
    Uptime:                 1 hour 13 min 19 sec
    
    Threads: 1  Questions: 141  Slow queries: 0  Opens: 135  Flush tables: 1  Open tables: 17  Queries per second avg: 0.032
    while when i run
    Code:
    mysqladmin -h myhostname -u root -p version
    i get
    Code:
    mysqladmin: connect to server at 'medic3' failed
    error: 'Access denied for user 'root'@'medic3.medichome' (using password: YES)'
    Code:
    netstat -tap
    gives
    Code:
    # netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 *:4137                  *:*                     LISTEN     2450/rpc.statd
    tcp        0      0 *:mysql                 *:*                     LISTEN     2148/mysqld
    tcp        0      0 *:sunrpc                *:*                     LISTEN     1828/portmap
    tcp        0      0 *:auth                  *:*                     LISTEN     2321/inetd
    tcp        0      0 *:ftp                   *:*                     LISTEN     2481/proftpd: (acce
    tcp        0      0 192.168.123.168:domain  *:*                     LISTEN     2049/named
    tcp        0      0 localhost.locald:domain *:*                     LISTEN     2049/named
    tcp        0      0 *:smtp                  *:*                     LISTEN     2381/master
    tcp        0      0 localhost.localdoma:953 *:*                     LISTEN     2049/named
    tcp6       0      0 *:imaps                 *:*                     LISTEN     2293/couriertcpd
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     2311/couriertcpd
    tcp6       0      0 *:pop3                  *:*                     LISTEN     2298/couriertcpd
    tcp6       0      0 *:imap2                 *:*                     LISTEN     2281/couriertcpd
    tcp6       0      0 *:www                   *:*                     LISTEN     2513/apache2
    tcp6       0      0 *:domain                *:*                     LISTEN     2049/named
    tcp6       0      0 *:ssh                   *:*                     LISTEN     2410/sshd
    tcp6       0      0 *:smtp                  *:*                     LISTEN     2381/master
    tcp6       0      0 ip6-localhost:953       *:*                     LISTEN     2049/named
    tcp6       0      0 *:https                 *:*                     LISTEN     2513/apache2
    tcp6       0      0 ::ffff:192.168.123.:ssh ::ffff:192.168.123:4113 ESTABLISHED2560/sshd: paul555
     
    Last edited: Jul 11, 2007
  7. falko

    falko Super Moderator Howtoforge Staff

    Please install phpMyAdmin, then open the mysql.user table in phpMyAdmin. You should have two records for root there, one with localhost in the Host column and one with another hostname (which seems to be wrong). Correct this other hostname. And while you're at it, you can also set the password for this user.
     
  8. paul55

    paul55 New Member

    I found my mistake.I just hadn't set a password for user root at myhostname :rolleyes: Sorry for my mistake and thanks for your time
     
  9. techpr

    techpr New Member

    I still have this similar problem.

    Code:
    mysqladmin -u root password xxxxxxxx
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    
    Code:
    mysqladmin -h myhostname -u root password xxxxxxxxx
    mysqladmin: connect to server at 'myhostname' failed
    error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'
    
    Stuck in this step.
     
    Last edited: Nov 3, 2007
  10. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ? What's in /etc/hosts?
     

Share This Page