Knowledge Base
Save up to  70% off.  Start your website today!

SQL Errors

If you have SQL connection errors, please make sure you have followed the instructions in our Remote Database Connection Setup article.

Note: The most common problem in connecting is due to an incorrect username and/or password. Please make sure the username you use matches the username created in the MySQL Databases section of your cPanel.

Examples of MySQL errors

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'Username'@'localhost' (using password: YES) in /home1/examplec/public_html/config.php on line 3
Couldn't connect to the server.

This kind of error clearly shows the issue. Access denied lets you know immediately that the database name or password is incorrect in your PHP file. The database and username must always have the appropriate prefix of username_ (replace username with your actual cPanel username and don't forget the underscore "_"). You can copy the correct spelling from your cPanel, under the MySQL Databases section.

Parse error: syntax error, unexpected T_STRING in /home1/examplec/public_html/index.php on line 31

This kind of error means you have made a mistake in your coding. Generally, it indicates missing punctuation as PHP code is very sensitive. Unfortunately, our support staff is not trained to deal with coding issues, and this may fall beyond our scope of support. Issues dealing with scripting, coding, or third-party products may be best consulted with a professional programmer, design group, or developer of the third-party product.

Did you find this article helpful?

* Your feedback is too short