Skip to content

mysqli_sql_exception #2002 #4640

Description

@mridah

Describe the bug
Database operations randomly result in the error:

mysqli_sql_exception #2002
No such file or directory

It doesn't always happen otherwise it might have been a code issue. It works perfectly for a while,
then randomly it throws this error, and then again starts working properly.

Screenshot from 2021-05-03 16-20-37

CodeIgniter 4 version
CodeIgniter: 4.0.3

The error log :
`
CRITICAL - 2021-05-03 15:54:30 --> No such file or directory
#0 /var/www/html/myproj/system/Database/BaseConnection.php(377): CodeIgniter\Database\MySQLi\Connection->connect()
#1 /var/www/html/myproj/system/Database/BaseConnection.php(643): CodeIgniter\Database\BaseConnection->initialize()
#2 /var/www/html/myproj/system/Database/BaseBuilder.php(2836): CodeIgniter\Database\BaseConnection->query()
#3 /var/www/html/myproj/system/Model.php(952): CodeIgniter\Database\BaseBuilder->delete()
#4 /var/www/html/myproj/app/Controllers/Users/Delete.php(43): CodeIgniter\Model->delete()
#5 /var/www/html/myproj/system/CodeIgniter.php(914): App\Controllers\Users\Delete->index()
#6 /var/www/html/myproj/system/CodeIgniter.php(400): CodeIgniter\CodeIgniter->runController()
#7 /var/www/html/myproj/system/CodeIgniter.php(308): CodeIgniter\CodeIgniter->handleRequest()
#8 /var/www/html/myproj/public/index.php(45): CodeIgniter\CodeIgniter->run()
#9 {main}
CRITICAL - 2021-05-03 16:04:32 --> No such file or directory
#0 /var/www/html/myproj/system/Database/BaseConnection.php(377): CodeIgniter\Database\MySQLi\Connection->connect()
#1 /var/www/html/myproj/system/Database/BaseConnection.php(643): CodeIgniter\Database\BaseConnection->initialize()
#2 /var/www/html/myproj/system/Database/BaseBuilder.php(1845): CodeIgniter\Database\BaseConnection->query()
#3 /var/www/html/myproj/system/Model.php(1716): CodeIgniter\Database\BaseBuilder->get()
#4 /var/www/html/myproj/app/Controllers/Users/Manage.php(40): CodeIgniter\Model->__call()
#5 /var/www/html/myproj/system/CodeIgniter.php(914): App\Controllers\Users\Manage->index()
#6 /var/www/html/myproj/system/CodeIgniter.php(400): CodeIgniter\CodeIgniter->runController()
#7 /var/www/html/myproj/system/CodeIgniter.php(308): CodeIgniter\CodeIgniter->handleRequest()
#8 /var/www/html/myproj/public/index.php(45): CodeIgniter\CodeIgniter->run()
#9 {main}

`

Context

  • OS: Ubuntu 20.04
  • Web server : Apache 2
  • PHP version 7.4.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions