[英]Access denied for user 'totallig_root'@'197.210.64.73' (using password: YES) when conneting to online database from localhost
I am trying to access my online database from localhost but gives the mentioned error. 我试图从本地主机访问我的在线数据库,但给出了上述错误。 I tested it online and it worked.
我在网上对其进行了测试,并且有效。
Under Databases , I have added my computer ip address to Remote MySQL . 在数据库下 ,我已将我的计算机IP地址添加到远程MySQL 。
Access denied for user 'totallig_root'@'197.210.64.73' (using password: YES)
用户'totallig_root'@'197.210.64.73'的访问被拒绝(使用密码:是)
my connection strings 我的连接字符串
$host = 'totallightschools.com:3306';
$user = '******';
$pass = '******';
$db = '******';
$con = mysqli_connect($host,$user,$pass,$db);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
If you have an MySQL user in your MySQL instance, with the name totallig_root
and given password, which is allowed to connect from your host ( 197.210.64.73
) you should be able to connect with this function: 如果您的MySQL实例中有一个MySQL用户,名称为
totallig_root
,并且允许从主机( 197.210.64.73
)连接,则应该能够连接此功能:
mysqli_connect($host,$user,$pass,$db,$port);
So you have to specify the port (if it's not the default port) in a seperate argument. 因此,您必须在单独的参数中指定端口(如果不是默认端口)。 The user in your MySQL instance should look something like this:
totallig_root@197.210.64.73
or totallig_root@%
(to allow to connect from all hosts) 您的MySQL实例中的用户应如下所示:
totallig_root@197.210.64.73
或totallig_root@%
(以允许从所有主机进行连接)
Source: http://php.net/manual/de/function.mysqli-connect.php 资料来源: http : //php.net/manual/de/function.mysqli-connect.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.