XF 2.0 Admincp Login Error

( Xenforo 2.0.4 )
admin.php error
I said clear the error logs on the server.
I check the database on the left, not on the right (xf_error_log table)

https://prnt.sc/iu7hhw


XF\Db\Exception: MySQL statement prepare error [1146]: Table 's*******l_sql.xf_error_log' doesn't exist in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 40
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 91
  6. XF\Db\AbstractAdapter->fetchOne() in src/XF/Mvc/Entity/Finder.php at line 1118
  7. XF\Mvc\Entity\Finder->total() in src/XF/Admin/Controller/Index.php at line 96
  8. XF\Admin\Controller\Index->actionIndex() in src/XF/Mvc/Dispatcher.php at line 249
  9. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
  10. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  11. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
  12. XF\App->run() in src/XF.php at line 328
  13. XF::runApp() in admin.php at line 13
NOTE: Was after updating (1.5.6 to 2.0.4) . The same error was given on localhost
 
Last edited:
Somehow the xf_error_log table has been deleted.
Did you do anything which may have caused that?
Any recent actions at all? Contact your host to see if they have done anything.

You can recreate it, I believe it should still be the same:
Code:
CREATE TABLE xf_error_log (
        error_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        exception_date INT UNSIGNED NOT NULL,
        user_id INT UNSIGNED DEFAULT NULL,
        ip_address VARBINARY(16) NOT NULL DEFAULT '',
        exception_type VARCHAR(75) NOT NULL,
        message TEXT NOT NULL,
        filename VARCHAR(255) NOT NULL,
        line INT UNSIGNED NOT NULL,
        trace_string MEDIUMTEXT NOT NULL,
        request_state MEDIUMBLOB NOT NULL,
        PRIMARY KEY (error_id),
        KEY exception_date (exception_date)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
 
Problem solved;

Code:
CREATE TABLE xf_error_log (
        error_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        exception_date INT UNSIGNED NOT NULL,
        user_id INT UNSIGNED DEFAULT NULL,
        ip_address VARBINARY(16) NOT NULL DEFAULT '',
        exception_type VARCHAR(75) NOT NULL,
        message TEXT NOT NULL,
        filename VARCHAR(255) NOT NULL,
        line INT UNSIGNED NOT NULL,
        trace_string MEDIUMTEXT NOT NULL,
        request_state MEDIUMBLOB NOT NULL,
        PRIMARY KEY (error_id),
        KEY exception_date (exception_date)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci

If you get an error, run the following command and try the above code again

Code:
DROP TABLE xf_error_log
 
Problem solved;

Code:
CREATE TABLE xf_error_log (
        error_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        exception_date INT UNSIGNED NOT NULL,
        user_id INT UNSIGNED DEFAULT NULL,
        ip_address VARBINARY(16) NOT NULL DEFAULT '',
        exception_type VARCHAR(75) NOT NULL,
        message TEXT NOT NULL,
        filename VARCHAR(255) NOT NULL,
        line INT UNSIGNED NOT NULL,
        trace_string MEDIUMTEXT NOT NULL,
        request_state MEDIUMBLOB NOT NULL,
        PRIMARY KEY (error_id),
        KEY exception_date (exception_date)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci

If you get an error, run the following command and try the above code again

Code:
DROP TABLE xf_error_log

Glad you got this sorted. Did you find out what happened to the table in the first place?
 
Top Bottom