0

美好的一天,首先我想为我的英语感到抱歉。安装最新的 WAMP 后,我无法从局域网中的远程机器访问我的 MySQL 服务器。看起来它拒绝 tcp 连接(在添加 bind-address telnet localhost 3306 拒绝 tcp 连接之前)。托盘中的我的 WAMP 图标是绿色的,所以一切看起来都很好(即使在与旧版本比较后的 my.ini 中)。我的 WAMPy 上线了。如果重要,Apache 已启用 Rewrite 模块。我什至禁用了防火墙。我使用 Free AVG(所以我认为它没有阻止任何东西)当我的同事想要连接时,他们会得到:

mysql_connect(): [2002] trying to connect via tcp://my-pc:3306.

当我尝试使用 Navicat Lite 时,我得到“无法连接到 'localhost' (10061) 上的 MySQL 服务器”以前在安装新的 WAMPy 之前禁用了所有 wamp 服务。

在家里一切正常,但在这里我迷路了第三天;/

C:\Documents and Settings\Administrator\Pulpit>mysqladmin -uroot -p version
Enter password: *****
mysqladmin Ver 8.42 Distrib 5.5.8, for Win32 on x86
Copyright (c) 2000, 2010, 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.

Server version 5.5.8-log
Protocol version 10
Connection localhost via TCP/IP
TCP port 3306
Uptime: 2 min 0 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26 Queries per second avg: 0.8 

c:/wamp/bin/mysql/mysql5.5.8/my.ini 内容

[client]
port        = 3306
socket      = /tmp/mysql.sock

[wampmysqld]
port        = 3306
socket      = /tmp/mysql.sock
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
basedir=c:/wamp/bin/mysql/mysql5.5.8
log-error=c:/wamp/logs/mysql.log
datadir=c:/wamp/bin/mysql/mysql5.5.8/data
bind-address=127.0.0.1 # after adding this line I can connect via Navicat

skip-federated

log-bin=mysql-bin

binlog_format=mixed

server-id   = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld]
port=3306

我还为我的 mysql 创建了新用户(root@localhost、root@127.0.0.1、root@192.168.%.%、root@%)。有谁知道我可以改变什么以使其正常工作?

4

1 回答 1

0

“我还为我的 mysql 创建了新用户(root@localhost、root@127.0.0.1、root@192.168.%.%、root@%)。有谁知道我可以改变什么以使其正常工作?”

  1. 我建议您为其他用户创建非 root 用户。

  2. 您可以使用服务器上的 mysql 命令行 shell 进行连接吗?mysql -uroot -ppassword -h127.0.0.1

  3. 你能从另一个工作站“ping my-pc”吗?

  4. 您可以使用服务器的IP地址从另一台计算机连接到服务器吗?mysql -uroot -ppassword -h192.168.无论你的服务器 IP 是什么。

于 2011-03-01T10:39:59.977 回答