table ci_session 不存在错误

table ci_session doesn't exist error

我试图通过 this link.As the initial step shown in the tutorial and codeigniter 教程在我的 codeigniter 中配置 ion_auth,我在 config.php 中设置了 seeion,如下所示:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

autoload.php

$autoload['libraries'] = array('session','database');

已创建 ci_session table:

CREATE TABLE IF NOT EXISTS `ci_sessions` (
    `id` varchar(128) NOT NULL,
    `ip_address` varchar(45) NOT NULL,
    `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
    `data` blob NOT NULL,
    KEY `ci_sessions_timestamp` (`timestamp`)
 );

但是当我加载我的 codeigniter 时,我得到这个错误:

        A Database Error Occurred
    Error Number: 1146

    Table 'db_platform.ci_session' doesn't exist

    SELECT `data` FROM `ci_session` WHERE `id` = '957v38u8kf237dnsbq5f63345opank6t'

    Filename: D:/xampp/htdocs/platform/system/database/DB_driver.php

    Line Number: 691

我不知道我哪里错了。我是 codeigniter 会话和 ion_auth 的新手。谁能帮帮我?

您的 Table 名称中有错字,因为在 create table 语法中它是 ci_sessions

CREATE TABLE IF NOT EXISTS `ci_sessions` (

并且在错误中显示 table 名称 ci_session

中的错误
SELECT `data` FROM `ci_session` WHERE `id` = '957v38u8kf237dnsbq5f63345opank6t'.

所以,您在 table 名称中缺少 s