hosts/hostname and MySQL prob in "Perfect Setup - Ubuntu 6.06 LTS Server" setup

Discussion in 'Installation/Configuration' started by angussf, Oct 30, 2006.

  1. angussf

    angussf New Member

    I'm trying to follow the step-by-step in "The Perfect Setup - Ubuntu 6.06 LTS Server", but when I get to the "hostname" step, something's not right. I've followed the steps on Page 3 as far as editing /etc/hosts with the static IP address and both the FQDN and the simple hostname (the relevant line is set to

    192.168.0.2 myserver.mydomain.ext myserver

    ), and /etc/hosts just reads "myserver". However, when I type "hostname" and "hostname -f" to test (as on P.3) "hostname" returns just "myserver" while "..-f" returns the FQDN version. What's wrong? I've restarted several times after making these edits (for other reasons).

    Code:
    root@myserver:~# cat /etc/hosts
    127.0.0.1       localhost.localdomain localhost
    192.168.0.2   myserver.mydomain.ext       myserver
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    
    root@myserver:~# cat /etc/hostname
    myserver
    
    root@myserver:~# hostname
    myserver
    
    root@myserver:~# hostname -f
    myserver.myddomain.ext
    I can get "hostname" to return the FQDN by editing "/etc/hostname" but then "sudo" fails.
    [EDIT an hour later: NEVER MIND - by editing /etc/hosts to the FQDN and rebooting, it suddenly started working. Go figure]

    Also, and this may be related to the above, I can't follow the second part of setting the MySQL root password successfully. Here's what I see:

    Code:
    root@myserver:~#
    root@myserver:~# mysqladmin -h myserver.myddomain.ext -u root password My.Pwd
    mysqladmin: connect to server at 'myserver.myddomain.ext' failed
    error: 'Host 'myserver.myddomain.ext' is not allowed to connect to this MySQL server'
    root@myserver:~# mysqladmin -h myserver -u root password My.Pwd
    mysqladmin: connect to server at 'myserver' failed
    error: 'Host 'myserver.myddomain.ext' is not allowed to connect to this MySQL server'
    
    When I run "netstatp -tap" it clearly shows mysql running with the correct domain name:
    Code:
    root@myserver:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 *:mysql                 *:*                     LISTEN     4796/mysqld
    tcp        0      0 myserver.mydomain.ext:domain *:*                     LISTEN     3853/named
    tcp        0      0 localhost:domain        *:*                     LISTEN     3853/named
    tcp        0      0 *:ssh                   *:*                     LISTEN     3626/sshd
    tcp        0      0 localhost:953           *:*                     LISTEN     3853/named
    tcp        0      0 myserver.mydomain.ext:mysql myserver.mydomain.ext:38148 TIME_WAIT  -
    
    I'd really appreciate suggestions or guidance here as to what I need to do to get this working.

    [EDIT an hour later: NEVER MIND on this one either! -- I used dselect to remove mysql-server mysql-client and libmysqlclient12-dev and re-installed them, and this time it worked, possibly because of the above fix to /etc/hostname

    Thanks!

    Angus S-F
    Tucson, AZ USA

    P.S. might want to edit the HowTo to include the need to set /etc/hostname to the FQDN.
     
    Last edited: Oct 31, 2006

Share This Page