CodeIgniter database error when opening the site
source link: https://www.codesd.com/item/codeigniter-database-error-when-opening-the-site.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CodeIgniter database error when opening the site
The website works fine for a while but in a few days returns this error :
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Filename: mysqli/mysqli_driver.php
Line Number: 202
Backtrace:
File: /var/www/html/application/controllers/Login.php Line: 8 Function: database
File: /var/www/html/index.php Line: 289 Function: require_once
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/CodeIgniter.php
Line Number: 500
Help will be appreciated
Thanks
Nipun
Three things possible. Your database has been shut down (or it has died). You have not setup database to use a unix socket when both client and server are on the same machine. Or socket is not readable and writable by web user.
Related Articles
How can I fix the error when opening the file?
Internal system error when opening the Lotus Notes XPages database
Multi-Step OLE DB Operation Generated Errors "When Opening the ADO Connection
Missing a usable directive or assembly reference error when deploying the site
LibGDX error when opening the zip file
The network path was not found to be an error when accessing the site
Get a JS error when publishing the site
SSL error when opening the input stream
The 'Guide must specify the type' error when opening the rc file in VS2010
Syntax error when opening the quotation mark
Tableau error when opening the server in the local file
session_regenerate_id (): Did the session object fail, when running the site through security scanners?
Automatically run the macro when opening the workbook?
MVC5 Entity Framework Code First error when creating the database When using ApplicationUser
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK