如何在 MYSQL 远程数据库中使用不同的用户登录?这是我所做的:
在 MYSQL 中以 root 身份登录:
'create user 'user'@'%' IDENTIFIED BY 'password';
'grant select on *.* to 'user'@'%';
然后我设置了一个 PHP 脚本,它的连接是这个:
$con = mysql_pconnect("xxx.xx.xxx.xxx","user","password");
$selected = mysql_select_db("database",$con);
Aaaand 它不工作:顺便说一下,我在云服务器上使用 LAMP;
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to MySQL server on 'xxx.xx.xxx.xx' (10061) in D:\path\index.php on line 21
我究竟做错了什么?
编辑:不是防火井问题;