Support Center

Common MySQL Errors

Last Updated: Jun 01, 2015 01:06PM CDT

If you are having SQL connection errors, please make sure you have followed the instructions in our Connect to Your Database Remotely article.

Note: by FAR the most common problem in connecting to your database is because you are using an  incorrect username and/or password. Make sure the username you use matches the username created in the MySQL Database section of your cPanel.

MySQL Error Examples

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 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_', just replace 'username' with your actual cPanel username and don't forget the underscore. You can copy the correct spelling from your cPanel dashboard from 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 isn't trained to deal with the gamut of code issues like this that our customers face, and this may fall beyond our scope of support. Issues dealing with scripting, coding or third-party product help may be best remedied by consulting with a professional programmer, developer or designer. We can assist with some issues, possibly, via our Proactive Support offering.

b2e1da5554fae60a8baf40cecd3cb9f6@asmallorange.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete