当我尝试使用它的远程ip地址连接到本地mysql数据库时,我得到了一个访问被拒绝的消息。当我尝试从外部机器连接到相同的数据库时,它工作正常,没有任何问题。当我使用localhost连接到本地数据库时,它也能很好地工作。例如,如果数据库服务器的ip是1.2.3.4,那么我会得到以下结果:
# From the db server
mysql -u username -h localhost -p #works perfectly
mysql -u username -h 127.0.0.1 -p #works perfectly
mysql -u username -h 1.2.3.4 -p #
我刚买了Coda 2,我想试一下mysql数据库连接的这个功能。我无法连接。出现的错误是:
Unable to connect to host 1.2.3.4, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges,
or try increasing the connection timeout (currently 0 seconds).
MySQL said: Can't connect to MySQL server on
我知道这个命令:
GRANT ALL PRIVILEGES
ON database.*
TO 'user'@'yourremotehost'
IDENTIFIED BY 'newpassword';
但是,它只允许我授予一个特定的IP地址来访问这个远程MySQL数据库。如果我想让任何远程主机都可以访问这个MySQL数据库,该怎么办?我该怎么做?基本上,我将这个数据库公开,这样每个人都可以访问它。
我无法连接到由主机提供商保存的MySQL数据库。
我已经在cPanel中正确设置了帐户,以便在从php服务器运行php代码时能够连接到数据库。
但是现在我想通过Mac上的数据库工具而不是phpmyadmin来访问它。我添加了我的IP ( IP和DNS名称.)到cPanel中的“远程数据库访问主机”。我已经尝试从PHP和直接连接。我总是得到:
MySQL Said: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (4)
Use the following configuration settings for con
当我尝试从本地的XAMPP php连接到远程mysql数据库时,它说
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host
'testhost.testserver.com' (11004) in D:\xampp\htdocs\cvsprojects\test\initdb.php
on line 24
我确信mysql主机、用户名、密码是正确的,可以连接。
我试图从托管数据库的不同服务器连接到mysql数据库,但遇到错误。
我猜这可能与远程权限有关。这是我可以改变的吗,还是我需要让我的托管公司来做?
<?php
$con = mysql_connect("mysql4-remote.hosting.net","myadmin","password123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>
Can't connect to MySQL server on
mysql -u user -p pass -h remotehost
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 96
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysq
我在RHEL6上跑。我安装了php和php-mysql。
<?php phpinfo(); ?>工作得很好。
但是我无法连接到MySQL,有办法确认php-mysql不在我的服务器上工作吗?
编辑
当我打开我的网页时,我试图连接到一个远程数据库,它显示Can't connect to MySQL server on 'ipaddress' (110)
远程数据库正在工作,我可以从我的ip和端口3306成功地将ip传送到该ip。
我一直在尝试访问C# Entity framework中的远程MySql数据库服务器,但以以下错误结束
{"Access denied for user 'test'@'%' to database 'test'"}
我的连接字符串是server='192.168.0.1';uid=test;database=test;password=1234
但是,如果我通过workbench访问数据库,它允许我访问server并inserting and deleting表中的数据。
是什么导致了这个错误?
我已经在DebianLenny5.0上安装了一个MySQL数据库,并试图使用PHP远程连接到该数据库。
这就是我登录的方式:
$con = mysql_pconnect("MY_IP_ADDRESS","root","MY_PASSWORD");
if (!$con)
die('Could not connect: ' . mysql_error());
这就是我遇到的错误:
Could not connect: Access denied for user 'root'@'li273-10.members
我正在使用PHP和MySQL建立一个数据库连接,唯一的变化是我尝试使用我的服务器IP地址从我的本地计算机访问我的远程服务器。
mysql_connect("x.xx.xx.x","username","password") or die(mysql_error());
我得到的错误是Unable to connect to the given host。用户拥有所有特权和权利。