douzong5473 2014-12-11 15:35
浏览 53
已采纳

Moodle中不存在表'mdl_sessions'

my moodle site display 'error reading from database'
after activating debugging in config.php error showed that table with name 'mdl_session' not exist in database

the error message is:

Debug info: Table 'mniknami_edu.mdl_sessions' doesn't exist
SELECT id, sid, state, userid, lastip, timecreated, timemodified FROM mdl_sessions     WHERE sid = ?
[array (
0 => 'lhdasq4iscedtqhvbs5j1lq833',
)]
Error code: dmlreadexception
Stack trace:    

line 441 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 996 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1415 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
line 1387 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1366 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 268 of /lib/classes/session/manager.php: call to moodle_database->get_record()
line 79 of /lib/classes/session/manager.php: call to core\session\manager::initialise_user_session()
line 806 of /lib/setup.php: call to core\session\manager::start()
line 35 of /config.php: call to require_once()
line 27 of /login/index.php: call to require()

my moodle work correctly 2 days ago and Since then, I did not make any changes or update to it
why this problem arise and how i can fixed it?
my moodle version is 2.6.1+

  • 写回答

2条回答 默认 最新

  • dongzhuo1880 2014-12-11 16:49
    关注

    Moodle sessions can be stored in differents places : database, files, memcached. According to https://docs.moodle.org/en/Session_handling the "[files] driver is used by default in new installation".

    Perhaps that was the case, but something was recently changed in config.php and Moodle is now trying to use the database for sessions?

    On a sidenote, using memcached for session makes a huge difference in performance (as said on Moodle's wiki), but the configuration needs to be done in config.php. If you have memcached available, this could fix the problem and make your site faster.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?