我有一个root帐户,它可以从任何主机连接到mysql服务器。如果我从mysql服务器运行命令(本地访问),它也能正常工作
grant all on *.* to testacc@'%';
但是如果我从不同的服务器(远程访问)连接Mysql,它就不能工作,它会抛出一个错误,比如:
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
请把问题和解决方案分享给我!
谢谢大家。
如何在MYSQL remote数据库中以不同的用户登录?下面是我所做的:
在MYSQL中以root用户身份登录:
'create user 'user'@'%' IDENTIFIED BY 'password';
'grant select on *.* to 'user'@'%';
然后,我设置了一个PHP脚本,它的连接如下:
$con = mysql_pconnect("xxx.xx.xxx.xxx","user","password");
$se
我的rails项目运行在服务器nginx +乘客上。我注意到思考斯芬克斯不能对异步连接做出反应。我在浏览器搜索查询上运行了两个选项卡,其中一个响应返回了以下错误:
Error connecting to Sphinx via the MySQL protocol. Error connecting to Sphinx via the MySQL protocol. Can't connect to MySQL server on '127.0.0.1' (111) ...
thinking_sphinx.yml:
development:
quiet_deltas:
我在另一台pc上有这个数据库,我想使用如下所示的连接字符串访问它。
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://192.168.0.1/dbtina","root","1234");
"dbtina“是我们的数据库。1234是我们的密码。我们已经将ip配置为这样,因为我们使用有线连接(点对点)。
Exception: Communications link failure
我无法连接到MySQL数据库。我搜索了一些解决方案,但似乎都没有效果,或者我可能还没有理解它们。这是设置:
let express = require("express");
let mysql = require("mysql");
let http = require("http");
let app = express();
http.createServer(app).listen(8000, function() {
console.log("Listening on http://localhost: