无法将opencart连接到mySQL数据库 [英] cant connect opencart to mySQL database

查看:153
本文介绍了无法将opencart连接到mySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的网站设置opencart,但是当我为MySQL数据库填写所有内容时,出现此错误:

I'm trying to set up opencart for my website, but when I fill in everything for the MySQL database I get this error:

No connection could be made because the target machine actively refused it.

我尝试将其放在本地主机上,我尝试在127.0.0.1上.当我尝试192.168.1.126(数据库服务器)时,它说找不到数据库

I've tried putting it on localhost, I've tried on 127.0.0.1. when I try on 192.168.1.126 (the database server) it says it can't find the database

托管PHP站点的服务器位于192.168.1.125

the server hosting the PHP site is on 192.168.1.125

我对SQL还是很陌生,我真的不太了解它.我正在SQL工作台中创建一个新数据库.并填写我需要的信息.如何解决此错误?

I'm very new to SQL, I really don't understand it fully. I'm creating a new database in SQL workbench. and filling in the info I need. How to I fix this error?

推荐答案

我的猜测是,仅允许您的数据库用户从127.0.0.1访问数据库服务器.您可能想授予它其他特权,然后在您的SQL Shell中运行类似

My guess is that your DB user is only allowed to access the DB server from 127.0.0.1. You might want to grant additional privileges to it and in your SQL shell run something like

GRANT ALL PRIVILEGES ON *.* To 'your-db-user'@'192.168.1.125'

这篇关于无法将opencart连接到mySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆