使用mysql和PHP从本地主机连接到远程数据库
So here is the situation. I have a database on a remote server that gives out quizzes and scores for individual students...
情况是这样的。我有一个远程服务器上的数据库,为每个学生提供测验和分数……
I also have a local database which contains the students names and their respective groups.
我还有一个本地数据库,其中包含学生姓名和他们各自的组。
What I want to do is to display the list of students per group then show the results of their scores from the remote database.. Is this possible??
我要做的是显示每个组的学生列表,然后显示远程数据库中他们的成绩。这是可能的吗? ?
Im currently running the script from my local computer using XAMMP like so mysql_connect("REMOTE SERVER ADDRESS","USERNAME", "PASSWORD") or die("Could not connect to MySQL server!");
Im当前使用XAMMP运行本地计算机的脚本,如so mysql_connect(“远程服务器地址”、“用户名”、“密码”)或die(“无法连接到MySQL服务器!”);
But all I get is Could not connect to MySql Server..
但是我得到的是无法连接到MySql服务器。
2 个解决方案
#1
3
GRANT ALL ON database.* TO user@ipaddress IDENTIFIED BY 'password';
You should force a reload of the grant tables using:
您应该使用以下方法强制重新加载授予表:
FLUSH PRIVILEGES;
更多相关文章
- 远程服务器CentOS7安装MySQL并用本地Navicat连接
- 如何将数据从MYsql服务器传输到iphone
- 阿里云服务器忘记mysql的登录密码时候如何修改密码
- MVC框架——学生信息管理系统(多表,多事务如何处理,一个用户如何共
- mysql数据库拷贝到另一个服务器上
- 阿里云服务器CentOS7.3上通过Docker安装MySQL
- 2、MySQL 8.0参考手册 连接到服务器并断开连接
- 如何启用对MySQL服务器的外部访问?
- 阿里云服务器MySQL远程连接问题