-1

我刚刚将 Ubuntu 11.04 升级到 11.10。升级工作正常(Apache/Apache-SSLMySQL/PHP),但不是 postfix 邮件服务器。在升级到 Ubuntu 12.04 之前,我想修复后缀的问题。

MySQL、Postfix 和 Dovecot 的版本已经升级。现在我有这个错误:

l server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Aug  3 06:53:56 ve postfix/trivial-rewrite[5578]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem

我可以连接到数据库:

root@ve:/etc/dovecot# mysql -u email_admin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 559
Server version: 5.1.69-0ubuntu0.11.10.1 (Ubuntu)


Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql>

对我来说真的很复杂。有人有想法吗?MySQL 5 的默认安装配置可以阻止 postfix 连接吗?

4

1 回答 1

0

让我们更具体地了解本地主机连接:我无法在本地主机上远程登录 MySQL。MySQL 已启动并运行,可与 Apache-SSL/PHP/MySQL 服务器正常工作,但我无法通过 telnet 连接:

telnet 127.0.0.1 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

本地主机也一样

telnet localhost 3306
Trying 127.0.0.1...
Trying ::1...
telnet: Unable to connect to remote host: Connection timed out

Netstat 确认 MySQL 正在 3306 端口上运行:

netstat -alpent | grep 3306
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      105        522804419   17231/mysqld
tcp        0      1 127.0.0.1:39268         127.0.0.1:3306          SYN_SENT    0          522915717   17433/auth
tcp        0      1 127.0.0.1:39254         127.0.0.1:3306          SYN_SENT    0          522915266   17434/auth
tcp        0      1 127.0.0.1:39250         127.0.0.1:3306          SYN_SENT    0          522915091   17432/auth

我可以连接 -h localhost:

mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 106
Server version: 5.1.69-0ubuntu0.11.10.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye

但我无法连接 -h 127.0.0.1:

mysql -h 127.0.0.1 -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (110)

然而我已经把 bind-address 127.0.01, vi /etc/mysql/my.cnf: ...

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = localhost
bind-address           = 127.0.0.1

我重新启动了 MySQL:

/etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
mysql stop/waiting
mysql start/running, process 17464

IPTables 规则为空:

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

所以我不知道要检查什么,Postfix 无法连接到 MySQL。有谁知道我应该检查什么?

实际上,我无法从服务器连接到任何服务:

telnet 127.0.0.1 80
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

telnet 127.0.0.1 443
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

我的 /etc/hosts 文件:

127.0.0.1       localhost
127.0.0.1       mail.mydomain.com
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# Auto-generated hostname. Please do not remove this comment.
205.xxx.yyy.zzz ve.uuuuuu.bbbb.cccc ve
于 2013-08-04T09:04:30.147 回答