gpt4 book ai didi

php - 无法访问moodle中的数据库

转载 作者:可可西里 更新时间:2023-11-01 07:02:54 24 4
gpt4 key购买 nike

我正在使用 moodle 并更改了网站的位置,但我遇到了这个错误。

我的 config.php 是:

<?php  /// Moodle Configuration File 

unset($CFG);

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'lightsys_test';
$CFG->dbuser = 'lightsys_test';
$CFG->dbpass = '123456a';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://www.lightsystem.ir/aya/moodle';

$CFG->dirroot = '/home/lightsys/public_html/aya/moodle';
$CFG->dataroot = '/home/lightsys/public_html/aya/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
// /home/lightsys/public_html/aya/moodle/
?>

我的错误是:

Error: Database connection failed.

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php

最佳答案

谢谢大家。

我的问题解决了。我没有为我的用户为我的数据库设置正确的权限,当我这样做时,我的问题就解决了。

关于php - 无法访问moodle中的数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9921091/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com