Friday, March 22, 2013

php Script cant connect to database


If your script can not connect to your database so you can following this steps.
1. First please check you have insert connect database details in your script you can check this in /home/user/public_html and file name could be wp-config.php,  configuration.php, config.php. It depends on your script which you are using. Find the following details in your sctipt.
If you have shell access then you can directly go in /home/user/public_html but if you do not have Shell access then you can Login in your cpanel get the database details from File Manager
Database name = (cpanelusername_databasename)
Database username = (cpanelusername_databaseuser)
Database password = (******)
If you see that all details are already exist in your database configuration file so copy these details in notepade and edit from editor.
2. Login in your cpanel and remove the username which you got from Configuration file
3. Recreate the database user and give the password which you got from Configuration file.
4. After that add the User to database.  If you dont know how to add user to database so you can follow the steps from this URL: http://linuxgo.net/?p=234

No comments:

Post a Comment