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 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题