If you ever get such an error Site Error: Unable to Load Site Preferences; No Preferences Found (mostly seen for Expression Engine Installations ) the fix is very simple
Full Error is
An Error Was Encountered
Unable to Load Site Preferences; No Preferences Found
The above error mainly refers to mysql connectivity issues and we need to check the mysql connection and get it fixed.
- Check Mysql server is up or not .
- Check if the database mentioned in the configuration file is empty or not.
- Check the mysql database user and password details details given in the configuration file and see if they are able to connect to mysql using those details.
- If you are using remote mysql servers , then you need to specify the correct mysql host and make sure the webserver is whitelisted in the webserver.
- Check the mysql error log and see if they are having any crashed tables and if so get it repaired using repair command.
In my case it was using remote server and the remote server was blocking access to that server from our webserver where the site is hosted. So To fix I had to whitelist my webserver ip in the remote mysql server and then all is working fine after that.
If you have ConfigServer Firewall installed in the server, then you can simply whitelist the webserver ip using the below command
# csf -a 192.168.1.1
If you have no firewall installed , you can use the below url to get it installed and then can use the above command.
For Fixing crashed tables, you can use the below doc which I wrote for mysql db adminstration . You can do the same via command line, mysql console and also from phpmyadmin
Hope this Guide will help you to fix the mysql related issue with the expression engine.