免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 5504 | 回复: 26

求助mysql连接错误 [复制链接]

论坛徽章:
0
发表于 2008-07-25 14:30 |显示全部楼层
本人搭建LAMP环境,放了一个phpbb3.0的论谈,连接数据库时提示如下

php连接错误

php连接错误

论坛徽章:
0
发表于 2008-07-25 14:34 |显示全部楼层
接上
在命令提示符下SHELL>mysql -u root -p 一点问题都没有可以创建库
我编译mysql时用的参数为
./configure --prefix=/site/lamp/mysql \
--with-embedded-server \
--without-debug \
--enable-assembler \
--with-charset=utf8 \
--with-extra-charsets=all \
--with-unix-socket-path=/site/lamp/mysql/tmp/mysql.sock \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--without-innodb \
--enable-thread-safe-client

网上搜索了一上,可以用telnet的方法试一下3306端口,我连了一下,能telnet过去但马上就断开了,不知道为什么??请DBA高手帮忙解决一下。谢了

论坛徽章:
0
发表于 2008-07-25 16:11 |显示全部楼层
使用mysqladmin -u root -pXXXXXX version
mysqladmin  Ver 8.41 Distrib 4.1.20, for redhat-linux-gnu on i386
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.56
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /opt/lamp/mysql/tmp/mysql.sock
Uptime:                 1 hour 50 min 5 sec

Threads: 1  Questions: 13  Slow queries: 0  Opens: 12  Flush tables: 1  Open tables: 7  Queries per second avg: 0.002

不知道这个是否显示正常

论坛徽章:
0
发表于 2008-07-25 16:13 |显示全部楼层
用telnet 192.168.1.200 3306 错误如下

EHost '192.168.1.60' is not allowed to connect to this MySQL server

失去了跟主机的连接。

论坛徽章:
0
发表于 2008-07-25 16:14 |显示全部楼层
怎么没人知道呢????

论坛徽章:
0
发表于 2008-07-25 16:47 |显示全部楼层
我使用mysqladmin -h localhost variables查看mysql的port值为3306,但telnet IP 3306却“提示不允许连接MySQL Server",有谁帮我解决。。。

论坛徽章:
0
发表于 2008-07-25 17:19 |显示全部楼层
192.168.1.200

这个主机确认有给他用户嘛?

论坛徽章:
0
发表于 2008-07-25 17:22 |显示全部楼层
有的,我可以用
SHELL>mysql -u phpbbs -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.56

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use bbs;
Database changed
mysql>

论坛徽章:
0
发表于 2008-07-25 17:27 |显示全部楼层
我用别的程序测试连接到数据库提示如下错误:
--------------------------------------------------------------
系统提示:不能连接到 MySQL 服务器 localhost
错误信息:Can't connect to local MySQL server through socket '/opt/lamp/mysql/tmp/mysql.sock' (13)
错误代码:2002
--------------------------------------------------------------

论坛徽章:
0
发表于 2008-07-26 09:34 |显示全部楼层
Show your result of statement select user,host from mysql.user !
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP