I have been working on the website named teacher.org.np which gives the error message saying Database Error: Unable to connect to the database:Could not connect to MySQL
I beleive for above error most of all will suggest to enter the databasename, database username and the password correctly at CONFIGURATION.PHP file but i find that the above information has been put accordingly and is 100% correct whereas the problem where i find is inside PHPMYADMIN if i clickd on any table name it does not give except giving error message. I haven't touch the database from my side it was working perfectly before but all of sudden i find the problem inside phpmyadmin. Therefore i need to know if this is a problem of webhosting ?
What is the exact error you get while DB connection using PHP? MySQL connection issues can be an issue with your database or credentials you use or lack of privileges or MySQL is not running / lack of MySQL PHP module ( there are other possibilities as well, like connection throttling / user ) .
1. Credentials: Make sure you use the proper credentials to access your DB. You can write a simple PHP script to test DB connectivity.
2. Privilege : Make sure you have added privilege to access the database for the user you use. Otherwise it will give back error.
3. Database: Run repair / optimize database from your end ( possibly via any control panel if you have any )
4. MySQL not running or lack of PHP module: You can't do anything on this until you have root access. If you have root, take corrective actions.
If all the above steps went fine from your end , contact your host with the exact error message. They will be able to help you.
You did not provide exact error which you are receiving in your PHPMyAdmin. Are your table carshed? If so you will have to repair it from PHPMyAdmin. Also, if you are on shared hosting server, you can contact your host as well.
For testing, can you install another small script which requires MySQL.
Most common cause of such error is explained by @nixtree above.
If you are on a shared hosting, contact your hosting provider.
█ YagHost - Pure SSD Hosting | Since 2007 | Average Response Time: 15 min
█ Web Hosting | Reseller Hosting | Managed VPS Hosting
█ 99.9% Server Uptime Guarantee | 24/7 Rapid Response Tech Support | 30 Day Money Back Guarantee
█ LopHost.com - Web Hosting Tutorials