Home > Backend Development > PHP Tutorial > php 连接mysql 远程连接(10060)

php 连接mysql 远程连接(10060)

WBOY
Release: 2016-06-23 14:15:36
Original
1022 people have browsed it

用php 连接 Mysql就出现 Can't connect to MySQL server on 'IP' (10060)

可用软件navicat连接没任何问题,如何把ip改为localhost没问题,可现在必须远程访问.

服务器是租的,没有修改权限

$con = mysql_connect(IP,name,pwd);

连不上啊,急救!!


回复讨论(解决方案)

要想远程连接mysql,就必须要mysql对访问者授权

如果你没有权限设置,那么就不要远程连接

可navicat就能连?

10060 是超时,就是说你那个ip连不上
不能改权限就放一个能连的php到服务器上,远程连这个php,由它转发sql命令操作

建议上截图  PHP配置截图和navicat的连接属性截图
这中间我推测是设置上的错误,有图有真相

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template