简体   繁体   English

从localhost连接到在线数据库时,用户'totallig_root'@'197.210.64.73'(使用密码:YES)拒绝访问

[英]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.73totallig_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.

相关问题 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)' - Access denied for user 'root'@'localhost' (using password: YES)' 使用MAMP拒绝用户'root'@'localhost'的访问(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) using MAMP 用户'root'@'localhost'的访问被拒绝(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) #1045-用户'root'@'localhost'的访问被拒绝(使用密码:是) - #1045 - Access denied for user 'root'@'localhost' (using password: YES) laravel 5用户“ root” @“ localhost”的访问被拒绝(使用密码:是) - laravel 5 Access denied for user 'root'@' localhost' (using password: YES) Illuminate\Database\QueryException: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (使用密码: YES) - Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) 当我尝试远程访问mysql时,拒绝用户'root'@'localhost'的访问(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) when i try accessing mysql remotely 重置 root 密码后,用户 'root'@'localhost' 的访问被拒绝(使用密码:YES) - Access denied for user 'root'@'localhost' (using password: YES) after resetting root password xampp localhost phpmyadmin 用户 'root'@'localhost' 访问被拒绝(使用密码:YES) - xampp localhost phpmyadmin Access denied for user 'root'@'localhost' (using password: YES) 警告:mysqli_connect():(HY000/1045):用户'root'@'localhost'的访问被拒绝(使用密码:YES)无法连接数据库 - Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) Could not connect database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM