我正在关注着名的教程,我在这一步
但是我在尝试运行时遇到了问题
postmap -q example.org mysql:/etc/postfix/mysql-virtual-box-domains.cf
我得到:
postmap:警告:连接到 mysql 服务器 127.0.0.1:在“读取初始通信数据包”时丢失与 MySQL 服务器的连接,系统错误:0
但是我可以通过 mysql: 连接到 mysqld
mysql -u mailuser -p
,密码为“foo”。.cf 看起来像这样:
user = mailuser
password = foo
hosts = 127.0.0.1
dbname = mailserver
query = SELECT 1 FROM virtual_domains WHERE name='%s'
可能是什么问题呢?
附录
my.cf 中的相关部分如下所示:
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 16K
myisam_sort_buffer_size = 8M
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
bind-address = 127.0.0.1