linux 环境,PHP连接MYSQL不上,用localhost可以,但是用127.0.0.1连接不上,是什么原因?

xqi8 2008-11-15 10:53:13
linux 环境,PHP连接MYSQL不上,用localhost可以,但是用127.0.0.1连接不上,是什么原因?
host改为localhost可以连接,用127.0.0.1就连接不上了。
...全文
436 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
sizemismatch 2008-11-16
  • 打赏
  • 举报
回复
??
qap22 2008-11-16
  • 打赏
  • 举报
回复
??
sizemismatch 2008-11-16
  • 打赏
  • 举报
回复
oo
qap22 2008-11-16
  • 打赏
  • 举报
回复
oo
xqi8 2008-11-16
  • 打赏
  • 举报
回复
arguments must be process or job IDS
xqi8 2008-11-15
  • 打赏
  • 举报
回复
启动的时候显示:
Timeout error occurred trying to start MySQL Daemon.


log:
081115 00:00:58 mysqld started
081115 0:01:00 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
081115 0:01:00 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
081115 0:01:00 InnoDB: Flushing modified pages from the buffer pool...
081115 0:01:00 InnoDB: Started; log sequence number 0 43634
/usr/libexec/mysqld: ready for connections.
Version: '4.1.11' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
081115 0:01:47 [Note] /usr/libexec/mysqld: Normal shutdown

081115 0:01:47 InnoDB: Starting shutdown...
081115 0:01:48 InnoDB: Shutdown completed; log sequence number 0 43634
081115 0:01:48 [Note] /usr/libexec/mysqld: Shutdown complete

081115 00:01:48 mysqld ended

081115 00:23:25 mysqld started
081115 0:23:26 InnoDB: Started; log sequence number 0 43634
/usr/libexec/mysqld: ready for connections.
Version: '4.1.11' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
081115 00:30:36 mysqld started
081115 0:30:36 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
081115 0:30:36 [ERROR] Do you already have another mysqld server running on port: 3306 ?
081115 0:30:36 [ERROR] Aborting

081115 0:30:36 [Note] /usr/libexec/mysqld: Shutdown complete

081115 00:30:36 mysqld ended

081115 00:34:36 mysqld started
081115 0:34:36 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
081115 0:34:36 [ERROR] Do you already have another mysqld server running on port: 3306 ?
081115 0:34:36 [ERROR] Aborting

081115 0:34:36 [Note] /usr/libexec/mysqld: Shutdown complete
xqi8 2008-11-15
  • 打赏
  • 举报
回复
[root@wsllinux ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost wsllinux
~
~


有的。
懒得去死 2008-11-15
  • 打赏
  • 举报
回复
给/etc/hosts里面添加:
127.0.0.1 localhost
懒得去死 2008-11-15
  • 打赏
  • 举报
回复
我才发现你的帖子发了两次!

执行一下命令:
kill -9 `ps aux | grep 3306 | grep -v 'grep' | awk '{print $2}'`

完了后再重新启动MySQL就可以了。

57,065

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧